stl size: minor fix to prevent segmentation fault when token is null
This commit is contained in:
parent
ad225ea745
commit
813c674611
|
@ -600,5 +600,5 @@ void CheckStl::size()
|
||||||
|
|
||||||
void CheckStl::sizeError(const Token *tok)
|
void CheckStl::sizeError(const Token *tok)
|
||||||
{
|
{
|
||||||
reportError(tok, Severity::possibleStyle, "stlSize", "Replace size() check against 0 with empty(): " + tok->str());
|
reportError(tok, Severity::possibleStyle, "stlSize", "Replace size() check against 0 with empty(): " + (tok ? tok->str() : std::string("variable name")));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue