QmlDesigner.PropertyEditor: crash fix

This crashed when the template definitions were missing.

Change-Id: I22aff1b9bb809ff59f108cb90f47b19c2db223fa
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
Thomas Hartmann
2013-08-12 17:08:39 +02:00
parent 8ffdcc60a6
commit bba547d1f2

View File

@@ -54,7 +54,7 @@ enum {
const char resourcePropertyEditorPath[] = ":/propertyeditor"; const char resourcePropertyEditorPath[] = ":/propertyeditor";
static QmlJS::SimpleReaderNode::Ptr s_templateConfiguration; static QmlJS::SimpleReaderNode::Ptr s_templateConfiguration = QmlJS::SimpleReaderNode::Ptr();
static inline QString propertyTemplatesPath() static inline QString propertyTemplatesPath()
{ {
@@ -345,7 +345,7 @@ QString PropertyEditorQmlBackend::templateGeneration(NodeMetaInfo type,
NodeMetaInfo superType, NodeMetaInfo superType,
const QmlObjectNode &objectNode) const QmlObjectNode &objectNode)
{ {
if (!templateConfiguration() && templateConfiguration()->isValid()) if (!templateConfiguration() || !templateConfiguration()->isValid())
return QString(); return QString();
QStringList imports = variantToStringList(templateConfiguration()->property(QLatin1String("imports"))); QStringList imports = variantToStringList(templateConfiguration()->property(QLatin1String("imports")));