From: James Moger Date: Fri, 31 Oct 2014 13:19:03 +0000 (-0400) Subject: Fix exception in FileTicketService when deleting a repository X-Git-Tag: v1.7.0~1^2~116^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Ftickets%2F13%2F213%2F1;p=gitblit.git Fix exception in FileTicketService when deleting a repository --- diff --git a/releases.moxie b/releases.moxie index 5fead38d..41259a7d 100644 --- a/releases.moxie +++ b/releases.moxie @@ -16,6 +16,7 @@ r27: { security: ~ fixes: - Fix exception when viewing a ticket with a patchset where the integration branch does not exist (issue-521, ticket-212) + - Fix exception when deleting a repository using the FileTicketService (issue-522, ticket-213) changes: - Replaced Dagger with Guice (ticket-80) - Use release name as root directory in Gitblit GO artifacts (ticket-109) diff --git a/src/main/java/com/gitblit/tickets/FileTicketService.java b/src/main/java/com/gitblit/tickets/FileTicketService.java index c8346d14..1e82f0de 100644 --- a/src/main/java/com/gitblit/tickets/FileTicketService.java +++ b/src/main/java/com/gitblit/tickets/FileTicketService.java @@ -493,6 +493,10 @@ public class FileTicketService extends ITicketService { @Override protected boolean deleteAllImpl(RepositoryModel repository) { Repository db = repositoryManager.getRepository(repository.name); + if (db == null) { + // the tickets no longer exist because the db no longer exists + return true; + } try { File dir = new File(db.getDirectory(), TICKETS_PATH); return FileUtils.delete(dir);