QmlDesigner.propertyEditor: crash fix

Setting an empty expression on a value not defined in the model
crashed.

Task-number: QTCREATORBUG-4312
This commit is contained in:
Thomas Hartmann
2011-04-18 10:26:52 +02:00
parent 5515703dc3
commit cf0d90f88e

View File

@@ -511,6 +511,9 @@ void PropertyEditor::changeExpression(const QString &name)
return; return;
} }
if (value->expression().isEmpty())
return;
if (fxObjectNode.expression(name) != value->expression() || !fxObjectNode.propertyAffectedByCurrentState(name)) if (fxObjectNode.expression(name) != value->expression() || !fxObjectNode.propertyAffectedByCurrentState(name))
fxObjectNode.setBindingProperty(name, value->expression()); fxObjectNode.setBindingProperty(name, value->expression());