From 2bd0c5e34a254009fe034a9cec5324e55166c4c8 Mon Sep 17 00:00:00 2001 From: James Moger Date: Mon, 7 Apr 2014 23:03:31 -0400 Subject: [PATCH] Fix possible NPE when deleting a repository and cleaning-up branch-based tickets --- src/main/java/com/gitblit/tickets/BranchTicketService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gitblit/tickets/BranchTicketService.java b/src/main/java/com/gitblit/tickets/BranchTicketService.java index f23a3259..56055a4a 100644 --- a/src/main/java/com/gitblit/tickets/BranchTicketService.java +++ b/src/main/java/com/gitblit/tickets/BranchTicketService.java @@ -872,7 +872,9 @@ public class BranchTicketService extends ITicketService implements RefsChangedLi } catch (Exception e) { log.error(null, e); } finally { - db.close(); + if (db != null) { + db.close(); + } } return false; } -- 2.39.5