From bc7243d5832e466772734e24991025e0e8b067b0 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sun, 4 Jan 2015 23:05:15 +0100 Subject: [PATCH] QColorDialog: fix a crash on small displays On a small display leftLay is left initialized to a null pointer, therefore don't try to dereference it. Task-number: QTBUG-43643 Change-Id: I9d22dac88a3a853ce154a6f64b35fc113abd9262 Reviewed-by: Marc Mutz --- src/widgets/dialogs/qcolordialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index b69dbfd650..f7f45c74ac 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -1768,7 +1768,8 @@ void QColorDialogPrivate::initWidgets() topLay->addWidget(cs); #else rightLay->addWidget(cs); - leftLay->addSpacing(cs->gl->margin()); + if (leftLay) + leftLay->addSpacing(cs->gl->margin()); #endif buttons = new QDialogButtonBox(q);