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();