From 52b84963e61c23e09e381373016300cdfcdcd662 Mon Sep 17 00:00:00 2001 From: firewave Date: Sun, 25 Apr 2010 12:35:09 +0200 Subject: [PATCH] Fixed Access Violation with --enable=style when no tokens exist --- lib/checkother.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 89311f052..fd073582d 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -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())