Fix crash in JarProcessorManager when the input jar does not have a manifest.
This commit is contained in:
		
							parent
							
								
									da66abfaef
								
							
						
					
					
						commit
						782344ac59
					
				
					 1 changed files with 7 additions and 1 deletions
				
			
		|  | @ -68,7 +68,13 @@ public class JarProcessorManager { | ||||||
| 		String jarProcessorHash = getJarProcessorHash(); | 		String jarProcessorHash = getJarProcessorHash(); | ||||||
| 
 | 
 | ||||||
| 		try (JarFile jar = new JarFile(file)) { | 		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))) { | 			if (!jarProcessorHash.equals(attributes.getValue(JAR_PROCESSOR_HASH_ATTRIBUTE))) { | ||||||
| 				return true; | 				return true; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue