[clangd] Fix compilation database detection

llvm-svn: 317838
This commit is contained in:
Sam McCall 2017-11-09 21:45:27 +00:00
parent f035b9d631
commit 39f457b36f
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ DirectoryBasedGlobalCompilationDatabase::tryLoadDatabaseFromPath(PathRef File) {
return CachedIt->second.get();
std::string Error = "";
auto CDB = tooling::CompilationDatabase::loadFromDirectory(File, Error);
if (CDB && Error.empty()) {
if (CDB) {
auto Result = CDB.get();
CompilationDatabases.insert(std::make_pair(File, std::move(CDB)));
return Result;