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.
When stream fails to open during loading of TOML file,
stream
remains set tonil
. Thefinally
block then triggers SIGSEGV when it tries to close the stream that was never fully opened. Only install thefinally
block oncestream
was initialized to fix this.