Commit cec271aa authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

Logger: Prevent a crash when logger is used during program initialization

parent 7556587a
......@@ -63,7 +63,12 @@ private:
auto msg = createMsg( std::forward<Args>( args )... );
auto l = s_logger.load( std::memory_order_consume );
if ( l == nullptr )
l = s_defaultLogger.get();
{
l = s_defaultLogger.get();
// In case we're logging early (as in, before the static default logger has been constructed, don't blow up)
if ( l == nullptr )
return;
}
switch ( lvl )
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment