Skip to content

Commit 503662f

Browse files
committed
Try to fix null pointer dereference
1 parent 55262f0 commit 503662f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/checkstl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1559,7 +1559,7 @@ void CheckStl::checkFindInsert()
15591559
if (!containerTok)
15601560
continue;
15611561
// In < C++17 we only warn for small simple types
1562-
if (!(keyTok->valueType()->isIntegral() || keyTok->valueType()->pointer > 0) && mSettings->standards.cpp < Standards::CPP17)
1562+
if (mSettings->standards.cpp < Standards::CPP17 && !(keyTok && keyTok->valueType() && (keyTok->valueType()->isIntegral() || keyTok->valueType()->pointer > 0)))
15631563
continue;
15641564

15651565
const Token *thenTok = tok->next()->link()->next();

0 commit comments

Comments
 (0)