Commits

Anonymous committed eaeb5a8

prevent NPEs when a URL is not a jar (jboss messing with our heads)

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@2043e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 485a68d

Comments (0)

Files changed (1)

File core/src/main/java/com/opensymphony/xwork2/util/finder/ClassFinder.java

 
     private List<String> jar(URL location) throws IOException {
         URL url = URLUtil.normalizeToFileProtocol(location);
-        InputStream in = url.openStream();
-        try {
-            JarInputStream jarStream = new JarInputStream(in);
-            return jar(jarStream);
-        } finally {
-            in.close();
-        }
+        if (url != null) {
+            InputStream in = url.openStream();
+            try {
+                JarInputStream jarStream = new JarInputStream(in);
+                return jar(jarStream);
+            } finally {
+                in.close();
+            }
+        } else if (LOG.isDebugEnabled())
+            LOG.debug("Unable to read [#0]", location.toExternalForm());
+        
+        return Collections.emptyList();
     }
 
     private List<String> jar(JarInputStream jarStream) throws IOException {