diff options
author | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2016-08-25 09:59:06 +0200 |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2016-08-25 17:28:55 +0000 |
commit | 5f895fe0e212428bae76c65f3b6eaa8a036c7672 (patch) | |
tree | 79f8abd5726075c5b9604c420d57bfb25f36e0e9 /src | |
parent | f4b2115b511ef95f921460d70957788ab496b70b (diff) |
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 <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/winrt/qwinrtmessagedialoghelper.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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<QMessageDialogOptions> 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); |