From 0b0e15c9b4f6f3139019feae7876bef0b620a72a Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Tue, 10 Sep 2024 15:56:17 +0000 Subject: [PATCH] Windows: Don't assume the log file was successfully opened --- Source/Windows/Common/Logging.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Windows/Common/Logging.cpp b/Source/Windows/Common/Logging.cpp index 0e9b8c9615..69abdf53eb 100644 --- a/Source/Windows/Common/Logging.cpp +++ b/Source/Windows/Common/Logging.cpp @@ -17,7 +17,7 @@ static void MsgHandler(LogMan::DebugLevels Level, const char* Message) { const auto Output = fextl::fmt::format("[{}][{:X}] {}\n", LogMan::DebugLevelStr(Level), GetCurrentThreadId(), Message); if (WineDbgOut) { WineDbgOut(Output.c_str()); - } else { + } else if (LogFile) { fwrite(Output.c_str(), 1, Output.size(), LogFile); } } @@ -26,7 +26,7 @@ static void AssertHandler(const char* Message) { const auto Output = fextl::fmt::format("[ASSERT] {}\n", Message); if (WineDbgOut) { WineDbgOut(Output.c_str()); - } else { + } else if (LogFile) { fwrite(Output.c_str(), 1, Output.size(), LogFile); } }