From 8d07490845170038b287e6a70a707f676ca1e3f4 Mon Sep 17 00:00:00 2001 From: Simon Chemouil Date: Sun, 20 Aug 2017 17:18:12 +0200 Subject: [PATCH] Issue #12: ReactiveResourceReader fails with NPE when a resource is missing --- .../io/primeval/codex/io/impl/ResourceFinderReaderImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/io/primeval/codex/io/impl/ResourceFinderReaderImpl.java b/src/main/java/io/primeval/codex/io/impl/ResourceFinderReaderImpl.java index de073e1..7a19746 100644 --- a/src/main/java/io/primeval/codex/io/impl/ResourceFinderReaderImpl.java +++ b/src/main/java/io/primeval/codex/io/impl/ResourceFinderReaderImpl.java @@ -77,6 +77,9 @@ private Promise getNonBundleResourcePath(ClassLoader classLoader, String r throws URISyntaxException { return PromiseHelper.wrap(() -> { URL resource = classLoader.getResource(resourcePath); + if (resource == null) { + throw new FileNotFoundException(resourcePath.toString()); + } return Paths.get(resource.toURI()); }); }