From 4532a9590b0859c7504a15f679df2bfaee726874 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 14 Nov 2017 09:28:06 -0700 Subject: QToolBar: Don't crash on macOS with 'minimal' QPA plugin 'minimal' doesn't provide any native interface. Change-Id: I116c9905977ccc6ededf0c6c41b92b6f785f2875 Reviewed-by: Jake Petroules --- src/widgets/widgets/qtoolbar.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp index 663e8214c0..243fb6d555 100644 --- a/src/widgets/widgets/qtoolbar.cpp +++ b/src/widgets/widgets/qtoolbar.cpp @@ -1120,6 +1120,8 @@ static bool waitForPopup(QToolBar *tb, QWidget *popup) static void enableMacToolBar(QToolBar *toolbar, bool enable) { QPlatformNativeInterface *nativeInterface = QApplication::platformNativeInterface(); + if (!nativeInterface) + return; QPlatformNativeInterface::NativeResourceForIntegrationFunction function = nativeInterface->nativeResourceFunctionForIntegration("setContentBorderAreaEnabled"); if (!function) -- cgit v1.2.3