From 5f895fe0e212428bae76c65f3b6eaa8a036c7672 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Thu, 25 Aug 2016 09:59:06 +0200 Subject: winrt: Check validity of options shared pointer QErrorMessage autotests managed to create a scenario where the options are not initialized yet, causing a crash later on. Change-Id: Iabad6f181f2bfdc81a9c73f0e67c8ba70753fec6 Reviewed-by: Friedemann Kleint Reviewed-by: Oliver Wolff --- src/plugins/platforms/winrt/qwinrtmessagedialoghelper.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/platforms/winrt/qwinrtmessagedialoghelper.cpp b/src/plugins/platforms/winrt/qwinrtmessagedialoghelper.cpp index bad15126d4..42fe030b23 100644 --- a/src/plugins/platforms/winrt/qwinrtmessagedialoghelper.cpp +++ b/src/plugins/platforms/winrt/qwinrtmessagedialoghelper.cpp @@ -108,6 +108,9 @@ bool QWinRTMessageDialogHelper::show(Qt::WindowFlags windowFlags, Qt::WindowModa Q_D(QWinRTMessageDialogHelper); QSharedPointer options = this->options(); + if (!options.data()) + return false; + const QString informativeText = options->informativeText(); const QString title = options->windowTitle(); const QString text = informativeText.isEmpty() ? options->text() : (options->text() + QLatin1Char('\n') + informativeText); -- cgit v1.2.3