Skip to content

Commit a8e7eea

Browse files
author
Vladimir Kotal
committed
be more robust when attempting to delete history
fixes #2837
1 parent e87b8f8 commit a8e7eea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

opengrok-web/src/main/java/org/opengrok/web/api/v1/controller/ProjectsController.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ public void deleteHistoryCache(@PathParam("project") String projectName) throws
207207
logger.log(Level.INFO, "deleting history cache for project {0}", projectName);
208208

209209
List<RepositoryInfo> repos = env.getProjectRepositoriesMap().get(project);
210+
if (repos == null || repos.isEmpty()) {
211+
logger.log(Level.INFO, "history cache for project {0} is not present", projectName);
212+
return;
213+
}
210214

211215
// Delete history cache data.
212216
HistoryGuru guru = HistoryGuru.getInstance();

0 commit comments

Comments
 (0)