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
This commit is contained in:
Thorbjørn Lindeijer
2009-11-26 16:22:03 +01:00
parent dd651204c9
commit b02d705ac4

View File

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