diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2021-06-02 16:24:33 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2021-06-03 08:15:55 +0000 |
commit | b9c9c37a515f9dd79fa4e9e6c8c0168d76e6d5e3 (patch) | |
tree | 41940ca1241c3c919637201a73987c99d92d8a04 | |
parent | 58d03f3f2f977b81b4c9224a3cfdca7802d89ff0 (diff) |
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>
-rw-r--r-- | src/plugins/cpptools/symbolfinder.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/cpptools/symbolfinder.cpp b/src/plugins/cpptools/symbolfinder.cpp index 0c0c1f3d15..7147f1d1c4 100644 --- a/src/plugins/cpptools/symbolfinder.cpp +++ b/src/plugins/cpptools/symbolfinder.cpp @@ -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); |