From 7ced77b654eb46af1221a55e315795c1be1753a0 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 2 Feb 2010 12:17:19 +0100 Subject: Fixed potential crash in mac style --- src/gui/styles/qmacstyle_mac.mm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index c2e5871..aab16cb 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -2412,9 +2412,11 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW break; case PM_ToolBarFrameWidth: ret = 1; - if (QMainWindow * mainWindow = qobject_cast(widget->parent())) - if (mainWindow->unifiedTitleAndToolBarOnMac()) - ret = 0; + if (widget) { + if (QMainWindow * mainWindow = qobject_cast(widget->parent())) + if (mainWindow->unifiedTitleAndToolBarOnMac()) + ret = 0; + } break; default: ret = QWindowsStyle::pixelMetric(metric, opt, widget); -- cgit v0.12