aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier De Cannière <olivier.decanniere@qt.io>2023-07-19 11:33:02 +0200
committerOlivier De Cannière <olivier.decanniere@qt.io>2023-07-25 14:33:15 +0200
commit07ca60dcc557dfd548e99b127ca27ccd7cee75ef (patch)
treecd298cf997e1259920892f8889445214451f82a7
parente97f1631c1983915cbf4a14ec6813d2fc0aafc67 (diff)
QQuickAnimation: Check animationInstance for null in animationGroupDirty
On this line group->currentTime() defaults to 0 if animationInstance of group is null. This happens to be the value the condition is checking for and leads to a failed Q_ASSERT(animationInstance) in animGroupPriv->restartFromCurrentLoop(). Add a check for nullptr to cover this case. Amends 0e69268b49f6eed71a7a3e6f16bb5098b572ef2b Task-number: QTBUG-68404 Pick-to: 6.5 6.6 Change-Id: I12236be3b42fc6bd2d185943f9e0474655d8a4c9 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Inho Lee <inho.lee@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-rw-r--r--src/quick/util/qquickanimation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp
index 5aa2eaa1f4..548ec8415a 100644
--- a/src/quick/util/qquickanimation.cpp
+++ b/src/quick/util/qquickanimation.cpp
@@ -175,7 +175,7 @@ void QQuickAbstractAnimationPrivate::animationGroupDirty()
if (animGroupPriv->running && !animGroupPriv->animationDirty) {
animGroupPriv->animationDirty = true;
- if (group->currentTime() == 0) {
+ if (animGroupPriv->animationInstance && group->currentTime() == 0) {
// restart if the animation didn't proceed yet.
animGroupPriv->restartFromCurrentLoop();
}