diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2014-05-21 20:24:08 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2014-05-22 07:44:23 +0200 |
commit | d7c68892ab33a22c5969594861c2af9ce05282ed (patch) | |
tree | b3a25312d74417699f5ae1988c2d34b2190a5453 | |
parent | 3432e0973b1860ddb775ea44ec42de19bf0387b7 (diff) | |
download | qt-creator-d7c68892ab33a22c5969594861c2af9ce05282ed.tar.gz |
QmlDesigner: Fix potential null dereference
Change-Id: I291d07548bbbe7c7ab75dc55004e3c44c4bf0020
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
-rw-r--r-- | src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp index ba180fbac4..0cf7b5016f 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp @@ -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; |