Commit 8b7f0358 authored by DonLakeFlyer's avatar DonLakeFlyer

Fix crash from bad toolbox reference during shutdown

parent c4478240
...@@ -92,8 +92,7 @@ void AppLogModel::threadsafeLog(const QString message) ...@@ -92,8 +92,7 @@ void AppLogModel::threadsafeLog(const QString message)
insertRows(line, 1); insertRows(line, 1);
setData(index(line), message, Qt::DisplayRole); setData(index(line), message, Qt::DisplayRole);
if (qgcApp()->logOutput()) { if (_logFile.fileName().isEmpty() && qgcApp()->logOutput()) {
if (_logFile.fileName().isEmpty()) {
QGCToolbox* toolbox = qgcApp()->toolbox(); QGCToolbox* toolbox = qgcApp()->toolbox();
// Be careful of toolbox not being open yet // Be careful of toolbox not being open yet
if (toolbox) { if (toolbox) {
...@@ -112,5 +111,4 @@ void AppLogModel::threadsafeLog(const QString message) ...@@ -112,5 +111,4 @@ void AppLogModel::threadsafeLog(const QString message)
QTextStream out(&_logFile); QTextStream out(&_logFile);
out << message << "\n"; out << message << "\n";
} }
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment