aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@qt.io>2021-10-05 10:29:32 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2021-10-07 10:18:59 +0000
commit50557abd03cb57ec414b9e7d15c154b6748eccfa (patch)
treefeb227e9d48f205a500cfc3e999a9bb05a8bad65
parent28b87ba4f4b84a89171527cd57c8c5cc7ed27aeb (diff)
QmlDesigner: Fix crash
If the target cannot be resolved the result is invalid. Task-number: QDS-5216 Change-Id: Ibd7884d6638ae653953347862ca1291f963aa3b3 Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
-rw-r--r--src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
index 12fff40c79..997852cfb2 100644
--- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
+++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
@@ -46,6 +46,7 @@
#include <qmlstate.h>
#include <annotationeditor/annotationeditor.h>
#include <utils/algorithm.h>
+#include <utils/qtcassert.h>
namespace QmlDesigner {
@@ -103,6 +104,7 @@ void StatesEditorView::removeState(int nodeId)
const auto propertyChanges = modelState.propertyChanges();
for (const QmlPropertyChanges &change : propertyChanges) {
const ModelNode target = change.target();
+ QTC_ASSERT(target.isValid(), continue);
if (target.locked())
lockedTargets.push_back(target.id());
}