diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-12-27 11:48:26 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-12-31 09:08:59 +0100 |
commit | 4b1d370f755578f60bd9c73ca98eeb8e71463caf (patch) | |
tree | 08aae00b9da9fa15e45105ee52b3547d5e034e3b /src/widgets/widgets/qmainwindow.cpp | |
parent | a63969081c2f1656636f6fbc24b402a0f72c410b (diff) |
Check platformNativeInterface pointer before dereferencing
QApplication::platformNativeInterface() returns null if started with
-platform offscreen.
Fixes: QTBUG-80946
Change-Id: I3ad03ad27148c8576bd3fab0b136827bb8d171ae
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Diffstat (limited to 'src/widgets/widgets/qmainwindow.cpp')
-rw-r--r-- | src/widgets/widgets/qmainwindow.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 16ed699137..e3dbe763e5 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -1364,6 +1364,8 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set) createWinId(); QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); + if (!nativeInterface) + return; // Not Cocoa platform plugin. QPlatformNativeInterface::NativeResourceForIntegrationFunction function = nativeInterface->nativeResourceFunctionForIntegration("setContentBorderEnabled"); if (!function) |