diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 6b711b9cd..f9547e7ba 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -2211,7 +2211,7 @@ void Tokenizer::simplifyLabelsCaseDefault() if (Token::Match(tok->next(),"[:{};]")) break; } - if (tok->str() != "case" && tok->next()->str() == ":") { + if (tok->str() != "case" && tok->next() && tok->next()->str() == ":") { tok = tok->next(); if (tok->next()->str() != ";") tok->insertToken(";");