core/log: fix nullptr crash in ThreadLogging

This commit is contained in:
Derock 2025-08-13 12:52:16 -04:00 committed by outfoxxed
parent a5431dd02d
commit 83f5af522d
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E

View file

@ -458,13 +458,13 @@ void ThreadLogging::onMessage(const LogMessage& msg, bool showInSparse) {
}
if (!this->detailedWriter.write(msg) || (this->detailedFile && !this->detailedFile->flush())) {
if (this->detailedFile) {
qCCritical(logLogging) << "Detailed logger failed to write. Ending detailed logs.";
}
this->detailedWriter.setDevice(nullptr);
if (this->detailedFile) {
this->detailedFile->close();
this->detailedFile = nullptr;
qCCritical(logLogging) << "Detailed logger failed to write. Ending detailed logs.";
}
}
}