forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Thomas Hartmann
parent
28b87ba4f4
commit
50557abd03
@@ -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());
|
||||
}
|
||||
|
Reference in New Issue
Block a user