From c90626f189d5a3942d1e240d30121a2bdafde454 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 20 Feb 2013 12:53:41 +0100 Subject: [PATCH] QMacStyle::drawControl(CE_ProgressBar): add missing null pointer check Do not spin off progress bar animations if QStyleOption::styleObject is not set. Task-number: QTBUG-29748 Change-Id: I4e17a4892e82cae48250afa7a270b15ca5730f46 Reviewed-by: Gabriel de Dietrich --- src/widgets/styles/qmacstyle_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index bb9230804c..5d83804d51 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -4259,7 +4259,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (isIndeterminate || tdi.value < tdi.max) { if (QProgressStyleAnimation *animation = qobject_cast(d->animation(opt->styleObject))) tdi.trackInfo.progress.phase = animation->animationStep(); - else + else if (opt->styleObject) d->startAnimation(new QProgressStyleAnimation(d->animateSpeed(QMacStylePrivate::AquaProgressBar), opt->styleObject)); } else { d->stopAnimation(opt->styleObject);