Add a null pointer check for parent before derefencing it

Change-Id: I5b411f50acc6719b36cdde9ae2dd766b29e9731c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
Andy Shaw 2015-04-09 08:58:32 +02:00
parent cd61b6c969
commit f0cee4568e

View File

@ -94,7 +94,7 @@ int QPageSetupDialog::exec()
parent = parent ? parent->window() : QApplication::activeWindow();
Q_ASSERT(!parent ||parent->testAttribute(Qt::WA_WState_Created));
QWindow *parentWindow = parent->windowHandle();
QWindow *parentWindow = parent ? parent->windowHandle() : 0;
psd.hwndOwner = parentWindow ? (HWND)QGuiApplication::platformNativeInterface()->nativeResourceForWindow("handle", parentWindow) : 0;
psd.Flags = PSD_MARGINS;