diff --git a/src/Lexer.cpp b/src/Lexer.cpp index 2c7f04df3..59630987b 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -1302,7 +1302,8 @@ std::string Lexer::typeToString (Lexer::Type type) //////////////////////////////////////////////////////////////////////////////// bool Lexer::isAllDigits (const std::string& text) { - return text.find_first_not_of ("0123456789") == std::string::npos; + return text.length () && + text.find_first_not_of ("0123456789") == std::string::npos; } ////////////////////////////////////////////////////////////////////////////////