forked from qt-creator/qt-creator
QmlDesigner: Fix puppet crash when property animation has no target
Fixes: QDS-6935 Change-Id: Ib6dae3a6c39a12e9e62bd494d5a27917d7f97048 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -1610,7 +1610,7 @@ void NodeInstanceServer::addAnimation(QQuickAbstractAnimation *animation)
|
||||
m_animations.push_back(animation);
|
||||
|
||||
QQuickPropertyAnimation *panim = qobject_cast<QQuickPropertyAnimation *>(animation);
|
||||
if (panim) {
|
||||
if (panim && panim->target()) {
|
||||
QObject *target = panim->target();
|
||||
QString property = panim->property();
|
||||
QVariant value = target->property(qPrintable(baseProperty(property)));
|
||||
|
@@ -534,7 +534,7 @@ void Qt5InformationNodeInstanceServer::handleParticleSystemDeselected()
|
||||
for (auto a : anim) {
|
||||
a->stop();
|
||||
QQuickPropertyAnimation *panim = qobject_cast<QQuickPropertyAnimation *>(a);
|
||||
if (panim)
|
||||
if (panim && panim->target())
|
||||
panim->target()->setProperty(qPrintable(baseProperty(panim->property())), animationDefaultValue(i));
|
||||
i++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user