diff --git a/lib/astutils.cpp b/lib/astutils.cpp index 4be2f8c7b..0925078ae 100644 --- a/lib/astutils.cpp +++ b/lib/astutils.cpp @@ -1320,6 +1320,8 @@ static const Variable* getArgumentVar(const Token* tok, int argnr) if (!type) return nullptr; const Scope* typeScope = type->classScope; + if (!typeScope) + return nullptr; const int argCount = numberOfArguments(tok); for (const Function &function : typeScope->functionList) { if (function.isConstructor())