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

This commit is contained in:
Roberto Raggi
2010-05-12 14:41:25 +02:00
parent 9381a3e7d8
commit c739119c2a

View File

@@ -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