fix (potential) crash when failing to read stream, crash with nullptr error message, modernize a bit
fix (potential) crash when failing to read stream, crash with nullptr error message, modernize a bit

mateidavid/zstr