Commit d7c68892 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

QmlDesigner: Fix potential null dereference



Change-Id: I291d07548bbbe7c7ab75dc55004e3c44c4bf0020
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 3432e097
......@@ -243,6 +243,11 @@ void PropertyEditorView::changeExpression(const QString &propertyName)
QmlObjectNode qmlObjectNode(m_selectedNode);
PropertyEditorValue *value = m_qmlBackEndForCurrentType->propertyValueForName(underscoreName);
if (!value) {
qWarning() << "PropertyEditor::changeExpression no value for " << underscoreName;
return;
}
if (qmlObjectNode.modelNode().metaInfo().isValid() && qmlObjectNode.modelNode().metaInfo().hasProperty(name)) {
if (qmlObjectNode.modelNode().metaInfo().propertyTypeName(name) == "QColor") {
if (QColor(value->expression().remove('"')).isValid()) {
......@@ -278,11 +283,6 @@ void PropertyEditorView::changeExpression(const QString &propertyName)
}
}
if (!value) {
qWarning() << "PropertyEditor::changeExpression no value for " << underscoreName;
return;
}
if (value->expression().isEmpty())
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment