diff --git a/src/main/java/carpet/script/argument/FileArgument.java b/src/main/java/carpet/script/argument/FileArgument.java index fa4cbed3..beaa0279 100644 --- a/src/main/java/carpet/script/argument/FileArgument.java +++ b/src/main/java/carpet/script/argument/FileArgument.java @@ -1,8 +1,6 @@ package carpet.script.argument; import carpet.CarpetServer; -import carpet.script.Context; -import carpet.script.LazyValue; import carpet.script.bundled.Module; import carpet.script.exception.InternalExpressionException; import carpet.script.exception.ThrowStatement; @@ -180,14 +178,11 @@ public class FileArgument Map env = new HashMap<>(); if (reason == Reason.CREATE) env.put("create", "true"); zipPath = resolve(getDescriptor(module, zipContainer)); + if (!Files.exists(zipPath) && reason != Reason.CREATE) return null; // no zip file try { zfs = FileSystems.newFileSystem(URI.create("jar:"+ zipPath.toUri().toString()), env); } - catch (FileSystemNotFoundException fsnfe) - { - return null; - } - catch (IOException e) + catch (FileSystemNotFoundException | IOException fsnfe) { throw new ThrowStatement("Unable to open zip file: "+zipContainer, Throwables.IO_EXCEPTION); }