diff --git a/test/testclangimport.cpp b/test/testclangimport.cpp index 8dc4eb370..5954e55a8 100644 --- a/test/testclangimport.cpp +++ b/test/testclangimport.cpp @@ -127,6 +127,9 @@ private: Tokenizer tokenizer(&settings, this); std::istringstream istr(clang); clangimport::parseClangAstDump(&tokenizer, istr); + if (!tokenizer.tokens()) { + return std::string(); + } return tokenizer.tokens()->stringifyList(true, false, false, false, false); }