sourcemod
sourcemod copied to clipboard
Fix rare crash with logs
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