From 7f19d37fe413aecbc0749dea83128b5dcbabf515 Mon Sep 17 00:00:00 2001 From: James Moger Date: Mon, 17 Mar 2014 13:25:39 -0400 Subject: [PATCH] Fix NPE in FileTicketService on finding all journals --- src/main/java/com/gitblit/tickets/FileTicketService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gitblit/tickets/FileTicketService.java b/src/main/java/com/gitblit/tickets/FileTicketService.java index 003f86ca..2247a66c 100644 --- a/src/main/java/com/gitblit/tickets/FileTicketService.java +++ b/src/main/java/com/gitblit/tickets/FileTicketService.java @@ -264,11 +264,15 @@ public class FileTicketService extends ITicketService { private List findAll(File dir, String filename) { List list = new ArrayList(); - for (File file : dir.listFiles()) { + File [] files = dir.listFiles(); + if (files == null) { + return list; + } + for (File file : files) { if (file.isDirectory()) { list.addAll(findAll(file, filename)); } else if (file.isFile()) { - if (file.getName().equals(filename)) { + if (file.getName().equalsIgnoreCase(filename)) { list.add(file); } } -- 2.39.5