From 83f5af522dc0ff1c00f2518af0c18d0fc44a428a Mon Sep 17 00:00:00 2001 From: Derock Date: Wed, 13 Aug 2025 12:52:16 -0400 Subject: [PATCH] core/log: fix nullptr crash in ThreadLogging --- src/core/logging.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/logging.cpp b/src/core/logging.cpp index cb3a214..909da03 100644 --- a/src/core/logging.cpp +++ b/src/core/logging.cpp @@ -458,13 +458,13 @@ void ThreadLogging::onMessage(const LogMessage& msg, bool showInSparse) { } if (!this->detailedWriter.write(msg) || (this->detailedFile && !this->detailedFile->flush())) { + this->detailedWriter.setDevice(nullptr); + if (this->detailedFile) { + this->detailedFile->close(); + this->detailedFile = nullptr; qCCritical(logLogging) << "Detailed logger failed to write. Ending detailed logs."; } - - this->detailedWriter.setDevice(nullptr); - this->detailedFile->close(); - this->detailedFile = nullptr; } }