diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 261f13fb1..d687f9939 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -2931,7 +2931,7 @@ void Tokenizer::setVarIdNew() } } else if (tok->str() == "}") { // Set variable ids in class declaration.. - if (!isC() && !executableScope.top()) { + if (!isC() && !executableScope.top() && tok->link()) { setVarIdClassDeclaration(tok->link(), variableId, scopestartvarid.top()); }