Fix rare crash with logs (#2161)

* Fix rare crash with logs

* Nullcheck instead

* Update smn_filesystem.cpp

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
This commit is contained in:
Benoist 2024-05-24 13:10:24 +02:00 committed by GitHub
parent e07c120cab
commit 4e73713fab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -317,6 +317,10 @@ public:
}
virtual bool LogPrint(const char *msg)
{
if (!g_pLogHook) {
return false;
}
cell_t result = 0;
g_pLogHook->PushString(msg);
g_pLogHook->Execute(&result);