diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 317d33b4f..31e70985e 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -2880,7 +2880,7 @@ bool Tokenizer::simplifyKnownVariables() bailOutFromLoop = tok3->link(); continue; } - else if (tok3->str() == "}" && tok3->link()->previous()->str() == ")") + else if (tok3->str() == "}" && tok3->link() && tok3->link()->previous()->str() == ")") { // Assignment was in the middle of possible loop, bail out. break;