From 48ca8a006d6c96af0b134ebf07daa35eb367d5d8 Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 31 Oct 2014 09:19:03 -0400 Subject: [PATCH] Fix exception in FileTicketService when deleting a repository --- releases.moxie | 1 + src/main/java/com/gitblit/tickets/FileTicketService.java | 4 ++++ 2 files changed, 5 insertions(+) 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); -- 2.39.5