Skip to content

Commit

Permalink
log/windows: Guard against null pointer dereference
Browse files Browse the repository at this point in the history
This is semantically correct since we can't claim we own a console
before we find out if we have one or need to set one up.

Nobody should be calling using_own_console() before
early_log_file_setup() finishes, but you never know. People in this
project have surprised me before.
  • Loading branch information
irydacea committed Oct 26, 2020
1 parent cb867c0 commit 7c9bd06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/log_windows.cpp
Expand Up @@ -484,7 +484,7 @@ void enable_native_console_output()

bool using_own_console()
{
return lfm->owns_console();
return lfm && lfm->owns_console();
}

void finish_log_file_setup()
Expand Down

0 comments on commit 7c9bd06

Please sign in to comment.