Revert "Remove unnecessary null check (#3213)"

This reverts commit 6d13975def.
This commit is contained in:
Daniel Marjamäki 2021-05-01 18:54:51 +02:00
parent 6d13975def
commit e6d1b44758
1 changed files with 1 additions and 1 deletions

View File

@ -1378,7 +1378,7 @@ void CheckStl::if_find()
continue; continue;
const Token *conditionStart = scope.classDef->next(); const Token *conditionStart = scope.classDef->next();
if (Token::simpleMatch(conditionStart->astOperand2(), ";")) if (conditionStart && Token::simpleMatch(conditionStart->astOperand2(), ";"))
conditionStart = conditionStart->astOperand2(); conditionStart = conditionStart->astOperand2();
for (const Token *tok = conditionStart; tok->str() != "{"; tok = tok->next()) { for (const Token *tok = conditionStart; tok->str() != "{"; tok = tok->next()) {