From 96d2666a6cbf48dca18c90ebe557dcf66550f5b1 Mon Sep 17 00:00:00 2001 From: Alexander Mai Date: Fri, 18 Apr 2014 21:19:49 +0200 Subject: [PATCH] Fix crash in SymbolDatabase - errorLogger may be 0 --- lib/symboldatabase.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index c0d1a1fad..f7fae721d 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -48,9 +48,10 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti // find all scopes for (const Token *tok = _tokenizer->tokens(); tok; tok = tok ? tok->next() : nullptr) { // #5593 suggested to add here: - _errorLogger->reportProgress(_tokenizer->getSourceFilePath(), - "SymbolDatabase", - tok->progressValue()); + if (_errorLogger) + _errorLogger->reportProgress(_tokenizer->getSourceFilePath(), + "SymbolDatabase", + tok->progressValue()); // Locate next class if (Token::Match(tok, "class|struct|union|namespace ::| %var% {|:|::") && tok->strAt(-1) != "friend") {