From c811fd31b19133215c8e0e29e279be9bb92840ac Mon Sep 17 00:00:00 2001 From: dfsek Date: Tue, 7 Jun 2022 11:17:07 -0700 Subject: [PATCH] warn about nonexistent classpath resources --- .../base/src/main/java/com/dfsek/terra/AbstractPlatform.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/implementation/base/src/main/java/com/dfsek/terra/AbstractPlatform.java b/common/implementation/base/src/main/java/com/dfsek/terra/AbstractPlatform.java index e335c6461..dac046ee5 100644 --- a/common/implementation/base/src/main/java/com/dfsek/terra/AbstractPlatform.java +++ b/common/implementation/base/src/main/java/com/dfsek/terra/AbstractPlatform.java @@ -291,6 +291,10 @@ public abstract class AbstractPlatform implements Platform { logger.debug("Copying resource {}", resourcePath); try(InputStream is = getClass().getResourceAsStream("/" + resourcePath); OutputStream os = new FileOutputStream(resource)) { + if(is == null) { + logger.error("Resource {} doesn't exist on the classpath!", resourcePath); + return; + } IOUtils.copy(is, os); } catch(IOException e) { throw new UncheckedIOException(e);