summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-08-28 15:55:56 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-08-28 15:55:56 +0000
commitea575566702ca3609854520daf37c655d4c88483 (patch)
treed9cb19e6a6235de6791b98afc3dff371f74046e7 /java/sca
parent5a518addab1062f8a155f3491441605f2b42d14f (diff)
Fix NPE when contribution jar doesn't have a manifest
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@808928 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
-rw-r--r--java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java b/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java
index 41b3064d3f..71e90bf010 100644
--- a/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java
+++ b/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java
@@ -37,6 +37,7 @@ import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
import java.util.jar.JarFile;
+import java.util.jar.Manifest;
public class LauncherMain {
@@ -166,8 +167,13 @@ public class LauncherMain {
return false;
}
JarFile jar = new JarFile(f);
- String mfc = jar.getManifest().getMainAttributes().getValue("Main-Class");
- return mfc != null && mfc.length() > 0;
+ Manifest mf = jar.getManifest();
+ if (mf != null) {
+ String mfc = jar.getManifest().getMainAttributes().getValue("Main-Class");
+ return mfc != null && mfc.length() > 0;
+ } else {
+ return false;
+ }
}
/**
* Gets the jars matching a config classpath property