Commit a0909989 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Fixes: Possible crash in completeMember.

parent ae7c99eb
...@@ -578,6 +578,8 @@ bool CppCodeCompletion::completeFunction(FullySpecifiedType exprTy, ...@@ -578,6 +578,8 @@ bool CppCodeCompletion::completeFunction(FullySpecifiedType exprTy,
QSet<QString> signatures; QSet<QString> signatures;
foreach (TypeOfExpression::Result p, resolvedTypes) { foreach (TypeOfExpression::Result p, resolvedTypes) {
FullySpecifiedType ty = p.first; FullySpecifiedType ty = p.first;
if (! ty)
continue;
if (Function *fun = ty->asFunctionType()) { if (Function *fun = ty->asFunctionType()) {
if (TextEditor::CompletionItem item = toCompletionItem(fun)) { if (TextEditor::CompletionItem item = toCompletionItem(fun)) {
QString signature; QString signature;
...@@ -600,7 +602,7 @@ bool CppCodeCompletion::completeFunction(FullySpecifiedType exprTy, ...@@ -600,7 +602,7 @@ bool CppCodeCompletion::completeFunction(FullySpecifiedType exprTy,
bool CppCodeCompletion::completeMember(const QList<TypeOfExpression::Result> &results, bool CppCodeCompletion::completeMember(const QList<TypeOfExpression::Result> &results,
const LookupContext &context) const LookupContext &context)
{ {
if (results.isEmpty()) if (results.isEmpty() || ! results.first().first)
return false; return false;
TypeOfExpression::Result result = results.first(); TypeOfExpression::Result result = results.first();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment