Fixed possible crash in the code completion

Null pointer reference in a case where the global namespace is
explicitly specified using ::

Task-number: QTCREATORBUG-351
Review-pending-by: Roberto Raggi
(cherry picked from commit b02d705ac4)
This commit is contained in:
Thorbjørn Lindeijer
2009-11-26 16:22:03 +01:00
committed by con
parent b351cc9795
commit 3defa28174

View File

@@ -513,8 +513,8 @@ void LookupContext::expandFunction(Function *function,
q->isGlobal()); q->isGlobal());
const QList<Symbol *> candidates = resolveClassOrNamespace(nestedNameSpec, visibleScopes); const QList<Symbol *> candidates = resolveClassOrNamespace(nestedNameSpec, visibleScopes);
for (int j = 0; j < candidates.size(); ++j) { for (int j = 0; j < candidates.size(); ++j) {
expand(candidates.at(j)->asScopedSymbol()->members(), if (ScopedSymbol *scopedSymbol = candidates.at(j)->asScopedSymbol())
visibleScopes, expandedScopes); expand(scopedSymbol->members(), visibleScopes, expandedScopes);
} }
} }
} }