Fixed Access Violation with --enable=style when no tokens exist
This commit is contained in:
parent
f1d1d60924
commit
52b84963e6
|
@ -45,7 +45,8 @@ CheckOther instance;
|
|||
|
||||
void CheckOther::warningOldStylePointerCast()
|
||||
{
|
||||
if (!_settings->_checkCodingStyle || _tokenizer->fileLine(_tokenizer->tokens()).find(".cpp") == std::string::npos)
|
||||
if (!_settings->_checkCodingStyle ||
|
||||
(_tokenizer->tokens() && _tokenizer->fileLine(_tokenizer->tokens()).find(".cpp") == std::string::npos))
|
||||
return;
|
||||
|
||||
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
|
||||
|
|
Loading…
Reference in New Issue