Fix crash in JarProcessorManager when the input jar does not have a manifest.

dev/0.11
modmuss50 2021-09-29 19:44:26 +01:00
parent da66abfaef
commit 782344ac59
1 changed files with 7 additions and 1 deletions

View File

@ -68,7 +68,13 @@ public class JarProcessorManager {
String jarProcessorHash = getJarProcessorHash();
try (JarFile jar = new JarFile(file)) {
Attributes attributes = jar.getManifest().getMainAttributes();
Manifest manifest = jar.getManifest();
if (manifest == null) {
return false;
}
Attributes attributes = manifest.getMainAttributes();
if (!jarProcessorHash.equals(attributes.getValue(JAR_PROCESSOR_HASH_ATTRIBUTE))) {
return true;