Skip to content

Commit

Permalink
Fix rare crash with logs (#2161)
Browse files Browse the repository at this point in the history
* Fix rare crash with logs

* Nullcheck instead

* Update smn_filesystem.cpp

---------

Co-authored-by: Kenzzer <[email protected]>
  • Loading branch information
Kenzzer and Kenzzer committed May 24, 2024
1 parent e07c120 commit 4e73713
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/logic/smn_filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ class FileNatives :
}
virtual bool LogPrint(const char *msg)
{
if (!g_pLogHook) {
return false;
}

cell_t result = 0;
g_pLogHook->PushString(msg);
g_pLogHook->Execute(&result);
Expand Down

0 comments on commit 4e73713

Please sign in to comment.