From 4e73713fabedaa39848b7b4f85700990d519b55f Mon Sep 17 00:00:00 2001 From: Benoist <14257866+Kenzzer@users.noreply.github.com> Date: Fri, 24 May 2024 13:10:24 +0200 Subject: [PATCH] Fix rare crash with logs (#2161) * Fix rare crash with logs * Nullcheck instead * Update smn_filesystem.cpp --------- Co-authored-by: Kenzzer --- core/logic/smn_filesystem.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/logic/smn_filesystem.cpp b/core/logic/smn_filesystem.cpp index 0577bf4d59..205a150c53 100644 --- a/core/logic/smn_filesystem.cpp +++ b/core/logic/smn_filesystem.cpp @@ -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);