Skip to content
Snippets Groups Projects
Commit 8013eead authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.rewriter: crash fix

These sanity checks are needed
parent 6b11c398
No related branches found
No related tags found
No related merge requests found
......@@ -399,7 +399,8 @@ public:
return hasQuotes ? QVariant(cleanedValue) : cleverConvert(cleanedValue);
}
containingObject->lookupMember(name, m_context, &containingObject);
if (containingObject)
containingObject->lookupMember(name, m_context, &containingObject);
if (const Interpreter::QmlObjectValue * qmlObject = dynamic_cast<const Interpreter::QmlObjectValue *>(containingObject)) {
const QString typeName = qmlObject->propertyType(name);
......@@ -443,7 +444,8 @@ public:
return QVariant();
}
containingObject->lookupMember(name, m_context, &containingObject);
if (containingObject)
containingObject->lookupMember(name, m_context, &containingObject);
const Interpreter::QmlObjectValue * lhsQmlObject = dynamic_cast<const Interpreter::QmlObjectValue *>(containingObject);
if (!lhsQmlObject)
return QVariant();
......@@ -465,7 +467,8 @@ public:
rhsValueName = memberExp->name->asString();
}
rhsValueObject->lookupMember(rhsValueName, m_context, &rhsValueObject);
if (rhsValueObject)
rhsValueObject->lookupMember(rhsValueName, m_context, &rhsValueObject);
const Interpreter::QmlObjectValue *rhsQmlObjectValue = dynamic_cast<const Interpreter::QmlObjectValue *>(rhsValueObject);
if (!rhsQmlObjectValue)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment