status-im / nim-toml-serialization

Flexible TOML serialization [not] relying on run-time type information.
Apache License 2.0
36 stars 7 forks source link

Do not close `nil` stream when it failed to open #87

Closed etan-status closed 4 months ago

etan-status commented 4 months ago

When stream fails to open during loading of TOML file, stream remains set to nil. The finally block then triggers SIGSEGV when it tries to close the stream that was never fully opened. Only install the finally block once stream was initialized to fix this.