Check that file passed to getFileInfo is not nil
This commit is contained in:
parent
0032912d10
commit
d198e397fd
1 changed files with 2 additions and 0 deletions
|
|
@ -1997,6 +1997,8 @@ proc getFileInfo*(handle: FileHandle): FileInfo =
|
||||||
rawToFormalFileInfo(rawInfo, result)
|
rawToFormalFileInfo(rawInfo, result)
|
||||||
|
|
||||||
proc getFileInfo*(file: File): FileInfo =
|
proc getFileInfo*(file: File): FileInfo =
|
||||||
|
if file.isNil:
|
||||||
|
raise newException(IOError, "File is nil")
|
||||||
result = getFileInfo(file.getFileHandle())
|
result = getFileInfo(file.getFileHandle())
|
||||||
|
|
||||||
proc getFileInfo*(path: string, followSymlink = true): FileInfo =
|
proc getFileInfo*(path: string, followSymlink = true): FileInfo =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue