summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authordef <dennis@felsin9.de>2015-03-10 15:24:20 +0100
committerdef <dennis@felsin9.de>2015-03-10 15:24:20 +0100
commitd198e397fd728311bd3c07807036ceeb6759f311 (patch)
treec5cf762dfc032c28d8f943514e13614bd1814144 /lib
parent0032912d101eb81134b82cb7cb7b0fe56fe97622 (diff)
downloadNim-d198e397fd728311bd3c07807036ceeb6759f311.tar.gz
Check that file passed to getFileInfo is not nil
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/os.nim2
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 =