Check that file passed to getFileInfo is not nil

This commit is contained in:
def
2015-03-10 15:24:20 +01:00
parent 0032912d10
commit d198e397fd

View File

@@ -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 =