]> source.dussan.org Git - pf4j.git/commitdiff
defense for #21
authorDecebal Suiu <decebal.suiu@gmail.com>
Sun, 24 Aug 2014 19:50:08 +0000 (22:50 +0300)
committerDecebal Suiu <decebal.suiu@gmail.com>
Sun, 24 Aug 2014 19:50:08 +0000 (22:50 +0300)
pf4j/src/main/java/ro/fortsoft/pf4j/DefaultExtensionFinder.java

index 90b5c542436edca1d39eca95c16efe0041ad0da7..758b0c31462faec64eadf57238f9f89f9a9d1ad0 100644 (file)
@@ -175,9 +175,13 @@ public class DefaultExtensionFinder implements ExtensionFinder, PluginStateListe
 
             try {
                 URL url = plugin.getPluginClassLoader().getResource(ExtensionsIndexer.EXTENSIONS_RESOURCE);
-                log.debug("Read '{}'", url.getFile());
-                Reader reader = new InputStreamReader(url.openStream(), "UTF-8");
-                ExtensionsIndexer.readIndex(reader, bucket);
+                if (url != null) {
+                    log.debug("Read '{}'", url.getFile());
+                    Reader reader = new InputStreamReader(url.openStream(), "UTF-8");
+                    ExtensionsIndexer.readIndex(reader, bucket);
+                } else {
+                    log.debug("Cannot find '{}'", ExtensionsIndexer.EXTENSIONS_RESOURCE);
+                }
 
                 if (bucket.isEmpty()) {
                     log.debug("No extensions found");