forked from qt-creator/qt-creator
CppTools: Guard against null pointer access
... when looking up definitions of variables.
Amends a0764603d0.
Fixes: QTCREATORBUG-24610
Change-Id: I79e6f69066eaa385013e722ec4793c27231ab8eb
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -347,7 +347,7 @@ Link attemptDeclDef(const QTextCursor &cursor, Snapshot snapshot,
|
||||
funcDecl = decl->postfix_declarator_list->value->asFunctionDeclarator();
|
||||
if (funcDecl)
|
||||
target = symbolFinder->findMatchingDefinition(funcDecl->symbol, snapshot);
|
||||
else
|
||||
else if (simpleDecl->symbols)
|
||||
target = symbolFinder->findMatchingVarDefinition(simpleDecl->symbols->value, snapshot);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user