From 47cc1944152051421c1a9d5bb53520711054d9bf Mon Sep 17 00:00:00 2001 From: Denny Date: Sun, 17 Dec 2017 07:34:47 -0500 Subject: [PATCH] Resolves issue with runtime exception when identifying application version string from jar manifest --- .../github/dsheirer/properties/SystemProperties.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/dsheirer/properties/SystemProperties.java b/src/main/java/io/github/dsheirer/properties/SystemProperties.java index 4608dfde..35565ddf 100644 --- a/src/main/java/io/github/dsheirer/properties/SystemProperties.java +++ b/src/main/java/io/github/dsheirer/properties/SystemProperties.java @@ -103,11 +103,16 @@ public class SystemProperties archivePath = archivePath.substring(0, archivePath.length() - "/WEB-INF/classes".length()); // Required for wars } - try (InputStream input = new URL(archivePath + "/META-INF/MANIFEST.MF").openStream()) { + try (InputStream input = new URL(archivePath + "/META-INF/MANIFEST.MF").openStream()) + { return new Manifest(input); - } catch (Exception e) { - throw new RuntimeException("Loading MANIFEST for class " + clz + " failed!", e); } + catch (Exception e) + { + mLog.error("Couldn't load jar manifest - probably not running from a jar release"); + } + + return null; } /**