Commit 32bb7bff authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlJS: Add missing null checks before using scopeChain().qmlTypes.

parent bfad59df
......@@ -309,7 +309,8 @@ const Value *Check::checkScopeObjectMember(const UiQualifiedId *id)
bool isAttachedProperty = false;
if (! propertyName.isEmpty() && propertyName[0].isUpper()) {
isAttachedProperty = true;
scopeObjects += _context.scopeChain().qmlTypes;
if (const ObjectValue *qmlTypes = _context.scopeChain().qmlTypes)
scopeObjects += qmlTypes;
}
if (scopeObjects.isEmpty())
......
......@@ -256,7 +256,8 @@ public:
bool isAttachedProperty = false;
if (! propertyName.isEmpty() && propertyName[0].isUpper()) {
isAttachedProperty = true;
scopeObjects += m_context->scopeChain().qmlTypes;
if (const Interpreter::ObjectValue *qmlTypes = m_context->scopeChain().qmlTypes)
scopeObjects += qmlTypes;
}
if (scopeObjects.isEmpty())
......
......@@ -730,7 +730,8 @@ int CodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
m_completions.append(idPropertyCompletion);
addCompletionsPropertyLhs(enumerateProperties(qmlScopeType), symbolIcon, PropertyOrder);
addCompletions(enumerateProperties(context->scopeChain().qmlTypes), symbolIcon, TypeOrder);
if (const Interpreter::ObjectValue *qmlTypes = context->scopeChain().qmlTypes)
addCompletions(enumerateProperties(qmlTypes), symbolIcon, TypeOrder);
if (ScopeBuilder::isPropertyChangesObject(context, qmlScopeType)
&& context->scopeChain().qmlScopeObjects.size() == 2) {
......
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