felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r810483 - /felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java
Date Wed, 02 Sep 2009 12:41:05 GMT
Author: gnodet
Date: Wed Sep  2 12:41:04 2009
New Revision: 810483

URL: http://svn.apache.org/viewvc?rev=810483&view=rev
Log:
Fix possible NPE

Modified:
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java?rev=810483&r1=810482&r2=810483&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java
Wed Sep  2 12:41:04 2009
@@ -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>*/();



Mime
View raw message