From: Decebal Suiu Date: Sun, 24 Aug 2014 19:50:08 +0000 (+0300) Subject: defense for #21 X-Git-Tag: release-0.10.0~30 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=579bae7c3da0e6bc6e6ac4efb7aa0080641a6079;p=pf4j.git defense for #21 --- diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultExtensionFinder.java b/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultExtensionFinder.java index 90b5c54..758b0c3 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultExtensionFinder.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultExtensionFinder.java @@ -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");