core/log: fix nullptr crash in ThreadLogging

This commit is contained in:
Derock authored and outfoxxed committed 2025-08-27 20:44:39 -07:00
1 parent 42420ea26d
commit f7597cdae2
1 file changed
+4 -4
+4 -4
View File
@@ -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;
}
}