diff options
author | James Moger <james.moger@gitblit.com> | 2014-03-17 13:25:39 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-03-17 13:28:10 -0400 |
commit | 7f19d37fe413aecbc0749dea83128b5dcbabf515 (patch) | |
tree | c621d1768fa3cd025568958e859ce28e4b5caee0 /src/main/java/com/gitblit/tickets/FileTicketService.java | |
parent | 4ff1429245b3748372643251a92d71821f257ccf (diff) | |
download | gitblit-7f19d37fe413aecbc0749dea83128b5dcbabf515.tar.gz gitblit-7f19d37fe413aecbc0749dea83128b5dcbabf515.zip |
Fix NPE in FileTicketService on finding all journals
Diffstat (limited to 'src/main/java/com/gitblit/tickets/FileTicketService.java')
-rw-r--r-- | src/main/java/com/gitblit/tickets/FileTicketService.java | 8 |
1 files 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<File> findAll(File dir, String filename) { List<File> list = new ArrayList<File>(); - 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); } } |