[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [frameworkintegration] src/kstyle: Prevent crash when no widget is passed to KStyle::styleHint
From: Hugo Pereira Da Costa <hugo.pereira () free ! fr>
Date: 2014-02-25 12:35:30
Message-ID: E1WIHEQ-00005g-Ac () scm ! kde ! org
[Download RAW message or body]
Git commit 62ded565fccf78c8a4895a25a82cdb5f7fa1eafc by Hugo Pereira Da Costa.
Committed on 25/02/2014 at 10:39.
Pushed by hpereiradacosta into branch 'master'.
Prevent crash when no widget is passed to KStyle::styleHint
REVIEW:116043
M +1 -1 src/kstyle/kstyle.cpp
http://commits.kde.org/frameworkintegration/62ded565fccf78c8a4895a25a82cdb5f7fa1eafc
diff --git a/src/kstyle/kstyle.cpp b/src/kstyle/kstyle.cpp
index c0528b3..2ff1031 100644
--- a/src/kstyle/kstyle.cpp
+++ b/src/kstyle/kstyle.cpp
@@ -439,7 +439,7 @@ int KStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget
KConfigGroup g(KSharedConfig::openConfig(), "Toolbar style");
bool useOthertoolbars = false;
- const QWidget *parent = widget->parentWidget();
+ const QWidget *parent = widget ? widget->parentWidget() : nullptr;
//If the widget parent is a QToolBar and the magic property is set
if (parent && qobject_cast< const QToolBar * >(parent)) {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic