From 6d886e9f75d04eb34cd34cac668606d027384f96 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Tue, 5 Jun 2018 12:31:20 +0200 Subject: [PATCH] Check for option->styleObject before accessing it BUG: 395028 FIXED-IN: 5.13.0 Differential Revision: https://phabricator.kde.org/D13336 --- kstyle/breezestyle.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index 28746216..8475eb52 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -5038,7 +5038,9 @@ namespace Breeze //try to understand if anywhere the widget is under mouse, not just the handle, use _animations in case of QWidget, option->styleObject in case of QML #if QT_VERSION >= 0x050000 - const bool widgetMouseOver( widget ? _animations->scrollBarEngine().isHovered( widget, QStyle::SC_ScrollBarGroove ) : option->styleObject->property("hover").toBool()); + bool widgetMouseOver( ( option->state & State_MouseOver ) ); + if( widget ) widgetMouseOver = _animations->scrollBarEngine().isHovered( widget, QStyle::SC_ScrollBarGroove ); + else if( option->styleObject ) widgetMouseOver = option->styleObject->property("hover").toBool(); #else const bool widgetMouseOver( _animations->scrollBarEngine().isHovered( widget, QStyle::SC_ScrollBarGroove ) ); #endif