commit | a38085a9d9f642b43935b1549f0c827cc2008182 | [log] [tgz] |
---|---|---|
author | Guillaume Nodet <gnodet@apache.org> | Wed Sep 02 12:41:04 2009 +0000 |
committer | Guillaume Nodet <gnodet@apache.org> | Wed Sep 02 12:41:04 2009 +0000 |
tree | 2c2d8838850f3f9d32dc61c2a81898e1363ba918 | |
parent | c070c8b1b7d91cb6059b8d44f4dc0f451c5dce95 [diff] |
Fix possible NPE git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@810483 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java b/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java index 34f83bb..168ad79 100644 --- a/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java +++ b/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java
@@ -142,6 +142,15 @@ try { Set/*<File>*/ files = scanner.scan(); + // Check that there is a result. If not, this means that the directory can not be listed, + // so it's presumably not a valid directory (it may have been deleted by someone). + // In such case, just sleep + if (files == null) + { + Thread.sleep(poll); + continue; + } + List/*<ArtifactListener>*/ listeners = FileInstall.getListeners(); List/*<Artifact>*/ deleted = new ArrayList/*<Artifact>*/(); List/*<Artifact>*/ modified = new ArrayList/*<Artifact>*/();