@@ -125,13 +125,13 @@ if (dl == null) { throw new RuntimeException("Can't list " + dir); } for (int i = 0; i < dl.length; i++) { File f = new File(d, dl[i]); - if (f.isDirectory() && f.canRead()) { + if (f.isDirectory()) { String[] dl2 = f.list(); - if (dl2.length >= 250) { + if (dl2 == null || dl2.length >= 250) { /* Heuristic to avoid scanning huge directories */ continue; } return dl[i]; }