Skip to content
Snippets Groups Projects
Commit a0909989 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Fixes: Possible crash in completeMember.

parent ae7c99eb
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment