Fix crash in SymbolDatabase - errorLogger may be 0
This commit is contained in:
parent
aecb072fc6
commit
96d2666a6c
|
@ -48,9 +48,10 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti
|
||||||
// find all scopes
|
// find all scopes
|
||||||
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok ? tok->next() : nullptr) {
|
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok ? tok->next() : nullptr) {
|
||||||
// #5593 suggested to add here:
|
// #5593 suggested to add here:
|
||||||
_errorLogger->reportProgress(_tokenizer->getSourceFilePath(),
|
if (_errorLogger)
|
||||||
"SymbolDatabase",
|
_errorLogger->reportProgress(_tokenizer->getSourceFilePath(),
|
||||||
tok->progressValue());
|
"SymbolDatabase",
|
||||||
|
tok->progressValue());
|
||||||
// Locate next class
|
// Locate next class
|
||||||
if (Token::Match(tok, "class|struct|union|namespace ::| %var% {|:|::") &&
|
if (Token::Match(tok, "class|struct|union|namespace ::| %var% {|:|::") &&
|
||||||
tok->strAt(-1) != "friend") {
|
tok->strAt(-1) != "friend") {
|
||||||
|
|
Loading…
Reference in New Issue