You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2014/01/07 10:24:59 UTC

git commit: Prevent NPE when the bundleUrl is null

Updated Branches:
  refs/heads/master 01d52b0ac -> bdd5ec05c


Prevent NPE when the bundleUrl is null


Project: http://git-wip-us.apache.org/repos/asf/karaf-eik/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf-eik/commit/bdd5ec05
Tree: http://git-wip-us.apache.org/repos/asf/karaf-eik/tree/bdd5ec05
Diff: http://git-wip-us.apache.org/repos/asf/karaf-eik/diff/bdd5ec05

Branch: refs/heads/master
Commit: bdd5ec05cd55cdf153a76dddb71578df4143857e
Parents: 01d52b0
Author: Jean-Baptiste Onofré <jb...@apache.org>
Authored: Tue Jan 7 10:24:10 2014 +0100
Committer: Jean-Baptiste Onofré <jb...@apache.org>
Committed: Tue Jan 7 10:24:10 2014 +0100

----------------------------------------------------------------------
 .../eik/ui/features/FeaturesBundlesStartLevels.java      | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf-eik/blob/bdd5ec05/plugins/org.apache.karaf.eik.ui/src/main/java/org/apache/karaf/eik/ui/features/FeaturesBundlesStartLevels.java
----------------------------------------------------------------------
diff --git a/plugins/org.apache.karaf.eik.ui/src/main/java/org/apache/karaf/eik/ui/features/FeaturesBundlesStartLevels.java b/plugins/org.apache.karaf.eik.ui/src/main/java/org/apache/karaf/eik/ui/features/FeaturesBundlesStartLevels.java
index 0d5c395..6fc7d21 100644
--- a/plugins/org.apache.karaf.eik.ui/src/main/java/org/apache/karaf/eik/ui/features/FeaturesBundlesStartLevels.java
+++ b/plugins/org.apache.karaf.eik.ui/src/main/java/org/apache/karaf/eik/ui/features/FeaturesBundlesStartLevels.java
@@ -66,9 +66,9 @@ public class FeaturesBundlesStartLevels {
 					String bundleStartLevel = bundle.getStartLevel();
 					
 					String startLevel = (bundleStartLevel != null) ? bundleStartLevel : featureStartLevel; 
-					if(startLevel != null) {
+					if (startLevel != null) {
 						String symbolicName = getSymbolicName(bundle.getBundleUrl());
-						if(symbolicName != null) {
+						if (symbolicName != null) {
 							symbolicNameToStartLevel.put(symbolicName, startLevel);
 						}
 					}
@@ -92,10 +92,13 @@ public class FeaturesBundlesStartLevels {
 		return symbolicNameToStartLevel.get(bundleSymbolicName);
 	}
 	
-	private String getSymbolicName(String bundleUrl){
+	private String getSymbolicName(String bundleUrl) {
+        if (bundleUrl == null) {
+            return null;
+        }
 		File bundlePath = new File(baseBundlesDir, converter.getPath(bundleUrl));
 		BundleDescription bundleDescription = karafPlatformModel.getState().getBundleByLocation(bundlePath.getAbsolutePath());
-		if(bundleDescription != null) {
+		if (bundleDescription != null) {
 			return bundleDescription.getSymbolicName();
 		} else {
 			return null;