From ecfabbcdbb84ef9cd24df149a6071c12e2459b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 15 Dec 2020 07:11:13 +0100 Subject: [PATCH] Fix Cppcheck warning nullPointerRedundantCheck --- lib/exprengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/exprengine.cpp b/lib/exprengine.cpp index 0d9530d52..bc8136e91 100644 --- a/lib/exprengine.cpp +++ b/lib/exprengine.cpp @@ -891,7 +891,7 @@ ExprEngine::ArrayValue::ArrayValue(DataBase *data, const Variable *var) size.push_back(std::make_shared(data->getNewSymbolName(), 1, ExprEngine::ArrayValue::MAXSIZE)); } - const Token *initToken = var->nameToken(); + const Token *initToken = var ? var->nameToken() : nullptr; while (initToken && initToken->str() != "=") initToken = initToken->astParent();