Skip to content

Commit

Permalink
Merge pull request #8 from ReactiveX/stevegury-recursivefilelist
Browse files Browse the repository at this point in the history
MacOSX WatchService check for null file in recursiveListFiles
  • Loading branch information
robertroeser committed Aug 26, 2015
2 parents ba043ff + 87a68e4 commit 46a740b
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ private Map<File, Long> createLastModifiedMap(File file) {

private static Set<File> recursiveListFiles(File file) {
Set<File> files = new HashSet<File>();
files.add(file);
if (file.isDirectory()) {
for (File child : file.listFiles()) {
files.addAll(recursiveListFiles(child));
if (file != null) {
files.add(file);
if (file.isDirectory()) {
for (File child : file.listFiles()) {
files.addAll(recursiveListFiles(child));
}
}
}
return files;
Expand Down

0 comments on commit 46a740b

Please sign in to comment.