From f634ce3b9a38b163a6ef4d57d6bd61745d5248c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 15 Jan 2016 15:17:54 +0100 Subject: QFocusFrame: Don't crash on null d->widget. This can happen with a suitably complex use case (See QTBUG-50263) Change-Id: Ie8fa7b5872a902e802fda5795ade3369399ddb54 Task-number: QTBUG-50263 Reviewed-by: Timur Pocheptsov --- src/widgets/widgets/qfocusframe.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/widgets/widgets/qfocusframe.cpp b/src/widgets/widgets/qfocusframe.cpp index 5a403fa669..bf8cb30ef7 100644 --- a/src/widgets/widgets/qfocusframe.cpp +++ b/src/widgets/widgets/qfocusframe.cpp @@ -250,6 +250,10 @@ void QFocusFrame::paintEvent(QPaintEvent *) { Q_D(QFocusFrame); + + if (!d->widget) + return; + QStylePainter p(this); QStyleOption option; initStyleOption(&option); -- cgit v1.2.3