fixes #9456 by only calling c_fclose if non nil

(cherry picked from commit e190f485ae)
This commit is contained in:
Vindaar
2018-10-20 20:35:04 +02:00
committed by narimiran
parent b864c89479
commit a482e5735d

View File

@@ -130,7 +130,10 @@ else:
const
BufSize = 4000
proc close*(f: File) = discard c_fclose(f)
proc close*(f: File) =
if not f.isNil:
discard c_fclose(f)
proc readChar(f: File): char =
let x = c_fgetc(f)
if x < 0: