From 450ae3b8255548c461c7fadf31840c17bfafe276 Mon Sep 17 00:00:00 2001 From: Wagyourtail Date: Sat, 20 Jul 2024 20:37:56 -0500 Subject: [PATCH] check if not null first --- .../java/xyz/wagyourtail/jvmdg/compile/PathDowngrader.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/xyz/wagyourtail/jvmdg/compile/PathDowngrader.java b/src/main/java/xyz/wagyourtail/jvmdg/compile/PathDowngrader.java index c1075942..aacb7543 100644 --- a/src/main/java/xyz/wagyourtail/jvmdg/compile/PathDowngrader.java +++ b/src/main/java/xyz/wagyourtail/jvmdg/compile/PathDowngrader.java @@ -130,7 +130,9 @@ public byte[] apply(String s) { try(InputStream is = Files.newInputStream(path)) { Manifest manifest = new Manifest(is); Attributes attr = manifest.getMainAttributes(); - attr.putValue("JvmDowngrader-Version", Flags.jvmdgVersion); + if (Flags.jvmdgVersion != null) { + attr.putValue("JvmDowngrader-Version", Flags.jvmdgVersion); + } try (OutputStream os = Files.newOutputStream(outFile, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)) { manifest.write(os);