From f109a86b23fb0476e8d9b40e1dac7229a7b9c042 Mon Sep 17 00:00:00 2001 From: Cain Kilgore Date: Fri, 8 Sep 2017 23:05:22 +0100 Subject: [PATCH] Fixed small crash bug on exit --- interface/src/Application.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index f0ad0fe85b..3ee5406ad0 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -513,10 +513,13 @@ void messageHandler(QtMsgType type, const QMessageLogContext& context, const QSt auto avatarManager = DependencyManager::get(); auto myAvatar = avatarManager ? avatarManager->getMyAvatar() : nullptr; - QUuid fileLoggerSessionID = myAvatar->getSessionUUID(); - if (!fileLoggerSessionID.isNull()) { - qApp->getLogger()->setSessionID(fileLoggerSessionID); + if (myAvatar) { + QUuid fileLoggerSessionID = myAvatar->getSessionUUID(); + if (!fileLoggerSessionID.isNull()) { + qApp->getLogger()->setSessionID(fileLoggerSessionID); + } } + qApp->getLogger()->addMessage(qPrintable(logMessage + "\n")); } }