Skip to content

Commit d17251b

Browse files
kichunyasava-cska
authored andcommitted
Add exception due to server fail cause of sigfault.
1 parent 9d2136a commit d17251b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

server/src/building/BuildDatabase.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,12 @@ fs::path BuildDatabase::getRootForSource(const fs::path &path) const {
277277
}
278278

279279
fs::path BuildDatabase::getRootForFirstSource() const {
280-
return getRootForSource(sourceFileInfos.begin()->first);
280+
if (sourceFileInfos.empty()){
281+
throw CompilationDatabaseException("Source files not found");
282+
} else {
283+
return getRootForSource(sourceFileInfos.begin()->first);
284+
}
285+
}
281286
}
282287

283288
fs::path BuildDatabase::getBitcodeForSource(const fs::path &sourceFile) const {

0 commit comments

Comments
 (0)