Commit 8013eead authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.rewriter: crash fix

These sanity checks are needed
parent 6b11c398
......@@ -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)
......
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