From bba547d1f284df0d7538dda1ae8e0edc813cb9ce Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 12 Aug 2013 17:08:39 +0200 Subject: [PATCH] QmlDesigner.PropertyEditor: crash fix This crashed when the template definitions were missing. Change-Id: I22aff1b9bb809ff59f108cb90f47b19c2db223fa Reviewed-by: Marco Bubke --- .../components/propertyeditor/propertyeditorqmlbackend.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index 681fbab22e6..4f53f2dab67 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -54,7 +54,7 @@ enum { const char resourcePropertyEditorPath[] = ":/propertyeditor"; -static QmlJS::SimpleReaderNode::Ptr s_templateConfiguration; +static QmlJS::SimpleReaderNode::Ptr s_templateConfiguration = QmlJS::SimpleReaderNode::Ptr(); static inline QString propertyTemplatesPath() { @@ -345,7 +345,7 @@ QString PropertyEditorQmlBackend::templateGeneration(NodeMetaInfo type, NodeMetaInfo superType, const QmlObjectNode &objectNode) { - if (!templateConfiguration() && templateConfiguration()->isValid()) + if (!templateConfiguration() || !templateConfiguration()->isValid()) return QString(); QStringList imports = variantToStringList(templateConfiguration()->property(QLatin1String("imports")));