Try to fix null pointer dereference

This commit is contained in:
Daniel Marjamäki 2021-01-15 08:27:58 +01:00
parent 55262f03ec
commit 503662f625
1 changed files with 1 additions and 1 deletions

View File

@ -1559,7 +1559,7 @@ void CheckStl::checkFindInsert()
if (!containerTok)
continue;
// In < C++17 we only warn for small simple types
if (!(keyTok->valueType()->isIntegral() || keyTok->valueType()->pointer > 0) && mSettings->standards.cpp < Standards::CPP17)
if (mSettings->standards.cpp < Standards::CPP17 && !(keyTok && keyTok->valueType() && (keyTok->valueType()->isIntegral() || keyTok->valueType()->pointer > 0)))
continue;
const Token *thenTok = tok->next()->link()->next();