From d198e397fd728311bd3c07807036ceeb6759f311 Mon Sep 17 00:00:00 2001 From: def Date: Tue, 10 Mar 2015 15:24:20 +0100 Subject: [PATCH] Check that file passed to getFileInfo is not nil --- lib/pure/os.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index bf581667bd..d2e112c189 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 =