]> source.dussan.org Git - gitblit.git/commitdiff
Fix NPE in FileTicketService on finding all journals 34/34/1
authorJames Moger <james.moger@gitblit.com>
Mon, 17 Mar 2014 17:25:39 +0000 (13:25 -0400)
committerJames Moger <james.moger@gitblit.com>
Mon, 17 Mar 2014 17:28:10 +0000 (13:28 -0400)
src/main/java/com/gitblit/tickets/FileTicketService.java

index 003f86ca9b60aa00c9de77c15ce91ad066c20f10..2247a66c6e342cd86e6caab0be295fae639646a4 100644 (file)
@@ -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);
                                }
                        }