wtlucy closed pull request #20: MYFACES-4252 fix Classpath._searchDir NPE 2.1.X 
URL: https://github.com/apache/myfaces/pull/20
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/impl/src/main/java/org/apache/myfaces/view/facelets/util/Classpath.java 
b/impl/src/main/java/org/apache/myfaces/view/facelets/util/Classpath.java
index b2f5ee4d6..c82b1b0da 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/util/Classpath.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/util/Classpath.java
@@ -140,20 +140,23 @@ public Object run()
         }
         if (dirExists && dir.isDirectory())
         {
-            for (File file : dir.listFiles())
+            File[] dirFiles = dir.listFiles();
+            if (dirFiles != null) 
             {
-                String path = file.getAbsolutePath();
-                if (file.isDirectory())
+                for (File file : dirFiles)
                 {
-                    _searchDir(result, file, suffix);
-                }
-                else if (path.endsWith(suffix))
-                {
-                    result.add(file.toURI().toURL());
+                    String path = file.getAbsolutePath();
+                    if (file.isDirectory())
+                    {
+                        _searchDir(result, file, suffix);
+                    }
+                    else if (path.endsWith(suffix))
+                    {
+                        result.add(file.toURI().toURL());
+                    }
                 }
+                return true;
             }
-
-            return true;
         }
 
         return false;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to