diff --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp --- a/clang-tools-extra/clangd/XRefs.cpp +++ b/clang-tools-extra/clangd/XRefs.cpp @@ -299,7 +299,7 @@ RelationKind Predicate, const SymbolIndex *Index, llvm::StringRef MainFilePath) { - if (IDs.empty()) + if (IDs.empty() || !Index) return {}; static constexpr trace::Metric FindImplementorsMetric( "find_implementors", trace::Metric::Counter, "case");