mirror of
https://github.com/status-im/nim-serialization.git
synced 2025-02-17 14:36:27 +00:00
prevent null dereference (#13)
This commit is contained in:
parent
24474e69d1
commit
80da30b031
@ -89,7 +89,10 @@ template loadFile*(Format: distinct type,
|
|||||||
params: varargs[untyped]): auto =
|
params: varargs[untyped]): auto =
|
||||||
mixin init, ReaderType
|
mixin init, ReaderType
|
||||||
var stream = openFile(filename)
|
var stream = openFile(filename)
|
||||||
defer: stream[].close() # TODO: destructors
|
defer:
|
||||||
|
# TODO: destructors
|
||||||
|
if not stream.isNil:
|
||||||
|
stream[].close()
|
||||||
|
|
||||||
# TODO:
|
# TODO:
|
||||||
# Remove this when statement once the following bug is fixed:
|
# Remove this when statement once the following bug is fixed:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user