From: James Moger Date: Mon, 17 Mar 2014 17:25:39 +0000 (-0400) Subject: Fix NPE in FileTicketService on finding all journals X-Git-Tag: v1.4.1~3^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7f19d37fe413aecbc0749dea83128b5dcbabf515;p=gitblit.git Fix NPE in FileTicketService on finding all journals --- 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); } }