forked from qt-creator/qt-creator
CppTools: Add missing null pointer check
Prevents a crash trying to look for decl/def matches in non-applicable locations. Fixes: QTCREATORBUG-25806 Change-Id: I70961109267a2955bef0434a92f1d913b8c0c9c1 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -436,6 +436,9 @@ QList<Declaration *> SymbolFinder::findMatchingDeclaration(const LookupContext &
|
||||
Function *functionType)
|
||||
{
|
||||
QList<Declaration *> result;
|
||||
if (!functionType)
|
||||
return result;
|
||||
|
||||
QList<Declaration *> nameMatch, argumentCountMatch, typeMatch;
|
||||
findMatchingDeclaration(context, functionType, &typeMatch, &argumentCountMatch, &nameMatch);
|
||||
result.append(typeMatch);
|
||||
|
Reference in New Issue
Block a user