Commit c739119c authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Fixed Document::scopeAt() to always return a valid scope.

parent 9381a3e7
......@@ -401,7 +401,9 @@ void Document::setGlobalNamespace(Namespace *globalNamespace)
Scope *Document::scopeAt(unsigned line, unsigned column)
{
FindScopeAt findScopeAt(_translationUnit, line, column);
return findScopeAt(_globalNamespace);
if (Scope *scope = findScopeAt(_globalNamespace))
return scope;
return globalSymbols();
}
Symbol *Document::findSymbolAt(unsigned line, unsigned column) 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