Wrap all stream write calls with nil checks
Opened this issue · 0 comments
nettrino commented
There might be cases where config entry is invalid thus resolvePath
will fail and stream will be nil even after a newFileStream
. An example case is in https://github.com/crashappsec/nimutils/blob/main/src/nimutils/sinks.nim#L32 which has resulted in nil deref in some tests. Should we create a generic wrapper on all stream writes with a check for nil, throwing an exception or logging and returning if the stream is nil?