From 405fd567817a599fec6467aef684dfd1c2834383 Mon Sep 17 00:00:00 2001 From: Chao Shen Date: Thu, 18 Jan 2018 18:59:51 +0800 Subject: [PATCH] Crash Hotfix. --- src/indexer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/indexer.cc b/src/indexer.cc index 269bd853..04256fb1 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -422,7 +422,7 @@ void SetVarDetail(IndexVar* var, ? param->ns.QualifiedName(semanticContainer, def.short_name) : def.short_name; - if (cursor.get_kind() == CXCursor_EnumConstantDecl) { + if (cursor.get_kind() == CXCursor_EnumConstantDecl && semanticContainer) { CXType enum_type = clang_getEnumDeclIntegerType(semanticContainer->cursor); std::string hover = qualified_name + " = "; if (enum_type.kind == CXType_Int || enum_type.kind == CXType_Long ||