Fixes: Possible crash in completeMember.

This commit is contained in:
Roberto Raggi
2009-02-10 12:43:25 +01:00
parent ae7c99eb76
commit a0909989f7

View File

@@ -578,6 +578,8 @@ bool CppCodeCompletion::completeFunction(FullySpecifiedType exprTy,
QSet<QString> signatures;
foreach (TypeOfExpression::Result p, resolvedTypes) {
FullySpecifiedType ty = p.first;
if (! ty)
continue;
if (Function *fun = ty->asFunctionType()) {
if (TextEditor::CompletionItem item = toCompletionItem(fun)) {
QString signature;
@@ -600,7 +602,7 @@ bool CppCodeCompletion::completeFunction(FullySpecifiedType exprTy,
bool CppCodeCompletion::completeMember(const QList<TypeOfExpression::Result> &results,
const LookupContext &context)
{
if (results.isEmpty())
if (results.isEmpty() || ! results.first().first)
return false;
TypeOfExpression::Result result = results.first();