mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-07 13:33:22 +00:00
Check that file passed to getFileInfo is not nil
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user