diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp index 12fff40c798..997852cfb25 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp @@ -46,6 +46,7 @@ #include #include #include +#include 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()); }