Commit cea32d64 authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlJS: Fix possible segfaults with null documents.

parent 87e04df2
......@@ -1448,11 +1448,15 @@ ScopeChain &Context::scopeChain()
const ObjectValue *Context::typeEnvironment(const QmlJS::Document *doc) const
{
if (!doc)
return 0;
return _typeEnvironments.value(doc->fileName(), 0);
}
void Context::setTypeEnvironment(const QmlJS::Document *doc, const ObjectValue *typeEnvironment)
{
if (!doc)
return;
_typeEnvironments[doc->fileName()] = typeEnvironment;
}
......
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