diff options
author | def <dennis@felsin9.de> | 2015-03-10 15:24:20 +0100 |
---|---|---|
committer | def <dennis@felsin9.de> | 2015-03-10 15:24:20 +0100 |
commit | d198e397fd728311bd3c07807036ceeb6759f311 (patch) | |
tree | c5cf762dfc032c28d8f943514e13614bd1814144 /lib | |
parent | 0032912d101eb81134b82cb7cb7b0fe56fe97622 (diff) | |
download | Nim-d198e397fd728311bd3c07807036ceeb6759f311.tar.gz |
Check that file passed to getFileInfo is not nil
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/os.nim | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim index bf581667b..d2e112c18 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -1997,6 +1997,8 @@ proc getFileInfo*(handle: FileHandle): FileInfo = rawToFormalFileInfo(rawInfo, result) proc getFileInfo*(file: File): FileInfo = + if file.isNil: + raise newException(IOError, "File is nil") result = getFileInfo(file.getFileHandle()) proc getFileInfo*(path: string, followSymlink = true): FileInfo = |