Commit 1cbf0f26 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.metaInfo: crashfix

getNearestQmlObjectValue() might be 0 if qmldump could not dump the
C++ object.
parent 1f4e6b79
...@@ -498,6 +498,8 @@ bool NodeMetaInfoPrivate::isPropertyWritable(const QString &propertyName) const ...@@ -498,6 +498,8 @@ bool NodeMetaInfoPrivate::isPropertyWritable(const QString &propertyName) const
} }
const QmlJS::Interpreter::QmlObjectValue *qmlObjectValue = getNearestQmlObjectValue(); const QmlJS::Interpreter::QmlObjectValue *qmlObjectValue = getNearestQmlObjectValue();
if (!qmlObjectValue)
return true;
if (qmlObjectValue->hasProperty(propertyName)) if (qmlObjectValue->hasProperty(propertyName))
return qmlObjectValue->isWritable(propertyName); return qmlObjectValue->isWritable(propertyName);
else else
...@@ -526,7 +528,10 @@ bool NodeMetaInfoPrivate::isPropertyList(const QString &propertyName) const ...@@ -526,7 +528,10 @@ bool NodeMetaInfoPrivate::isPropertyList(const QString &propertyName) const
return true; return true;
} }
return getNearestQmlObjectValue()->isListProperty(propertyName); const QmlJS::Interpreter::QmlObjectValue *qmlObjectValue = getNearestQmlObjectValue();
if (!qmlObjectValue)
return false;
return qmlObjectValue->isListProperty(propertyName);
} }
bool NodeMetaInfoPrivate::isPropertyPointer(const QString &propertyName) const bool NodeMetaInfoPrivate::isPropertyPointer(const QString &propertyName) const
...@@ -550,7 +555,10 @@ bool NodeMetaInfoPrivate::isPropertyPointer(const QString &propertyName) const ...@@ -550,7 +555,10 @@ bool NodeMetaInfoPrivate::isPropertyPointer(const QString &propertyName) const
return true; return true;
} }
return getNearestQmlObjectValue()->isPointer(propertyName); const QmlJS::Interpreter::QmlObjectValue *qmlObjectValue = getNearestQmlObjectValue();
if (!qmlObjectValue)
return false;
return qmlObjectValue->isPointer(propertyName);
} }
bool NodeMetaInfoPrivate::isPropertyEnum(const QString &propertyName) const bool NodeMetaInfoPrivate::isPropertyEnum(const QString &propertyName) const
......
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