From e6d1b44758c8956a0dda950ad56846000fe77a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 1 May 2021 18:54:51 +0200 Subject: [PATCH] Revert "Remove unnecessary null check (#3213)" This reverts commit 6d13975def0fdb98dd295ed7fb102b0ddbd04ec2. --- lib/checkstl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index 1abb7d101..54e657b71 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -1378,7 +1378,7 @@ void CheckStl::if_find() continue; const Token *conditionStart = scope.classDef->next(); - if (Token::simpleMatch(conditionStart->astOperand2(), ";")) + if (conditionStart && Token::simpleMatch(conditionStart->astOperand2(), ";")) conditionStart = conditionStart->astOperand2(); for (const Token *tok = conditionStart; tok->str() != "{"; tok = tok->next()) {