sourcemod icon indicating copy to clipboard operation
sourcemod copied to clipboard

Fix rare crash with logs

Open Kenzzer opened this issue 1 year ago • 0 comments

Issue mentioned to Asherkin or Psychonic.

Long story short, if a metamod plugin happens to be detouring some game functions that SM unfortunately calls while initialising, and decides to have the console print something. It will trigger FileFileNatives::LogPrint, however by that point g_pLogHook has not yet been initialised, it's still a nullptr. This of course ends up with a nullpointer crash.

Let's ~~add a member property that tracks whether or not we've been initialised.~~ nullcheck g_pLogHook

Kenzzer avatar May 19 '24 10:05 Kenzzer