From dfd9d5a5ee271af4483815edc8604e98976c47e5 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Wed, 17 Jul 2019 12:35:25 +0200 Subject: [PATCH] try only show MessageBoxes if that is possible Change-Id: I70f41b7a2936d6797895559530050e8de54b2913 Reviewed-by: Eike Ziller --- src/app/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index e1756b2b950..2685966e0c3 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -120,15 +120,15 @@ static inline QString toHtml(const QString &t) static void displayHelpText(const QString &t) { - if (Utils::HostOsInfo::isWindowsHost()) - QMessageBox::information(0, QLatin1String(Core::Constants::IDE_DISPLAY_NAME), toHtml(t)); + if (Utils::HostOsInfo::isWindowsHost() && qApp) + QMessageBox::information(nullptr, QLatin1String(Core::Constants::IDE_DISPLAY_NAME), toHtml(t)); else qWarning("%s", qPrintable(t)); } static void displayError(const QString &t) { - if (Utils::HostOsInfo::isWindowsHost()) + if (Utils::HostOsInfo::isWindowsHost() && qApp) QMessageBox::critical(0, QLatin1String(Core::Constants::IDE_DISPLAY_NAME), t); else qCritical("%s", qPrintable(t));