diff --git a/clang-tools-extra/clang-doc/Representation.cpp b/clang-tools-extra/clang-doc/Representation.cpp --- a/clang-tools-extra/clang-doc/Representation.cpp +++ b/clang-tools-extra/clang-doc/Representation.cpp @@ -33,7 +33,7 @@ template llvm::Expected> reduce(std::vector> &Values) { - if (Values.empty()) + if (Values.empty() || !Values[0]) return llvm::createStringError(llvm::inconvertibleErrorCode(), "no value to reduce"); std::unique_ptr Merged = std::make_unique(Values[0]->USR); @@ -95,7 +95,7 @@ // Dispatch function. llvm::Expected> mergeInfos(std::vector> &Values) { - if (Values.empty()) + if (Values.empty() || !Values[0]) return llvm::createStringError(llvm::inconvertibleErrorCode(), "no info values to merge");