stl size: minor fix to prevent segmentation fault when token is null

This commit is contained in:
Daniel Marjamäki 2009-12-19 19:27:12 +01:00
parent ad225ea745
commit 813c674611
1 changed files with 1 additions and 1 deletions

View File

@ -600,5 +600,5 @@ void CheckStl::size()
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")));
}