diff --git a/src/source_clang.cc b/src/source_clang.cc index 5107a52..7a690f2 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -1588,7 +1588,7 @@ Source::ClangViewRefactor::ClangViewRefactor(const boost::filesystem::path &file } last_cursor = cursor; cursor = cursor.get_semantic_parent(); - } while(cursor.get_kind() != clangmm::Cursor::Kind::TranslationUnit); + } while(cursor && cursor.get_kind() != clangmm::Cursor::Kind::TranslationUnit); if(last_cursor.get_kind() != clangmm::Cursor::Kind::Namespace) data.emplace(++data.begin(), "");