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>*/();