karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject [5/5] git commit: Fix possible NPE
Date Mon, 26 May 2014 20:45:10 GMT
Fix possible NPE

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

Branch: refs/heads/master
Commit: 9b4a050ec78869f4e690c81d06a4b129ce3defca
Parents: 9812391
Author: Guillaume Nodet <gnodet@gmail.com>
Authored: Mon May 26 22:44:52 2014 +0200
Committer: Guillaume Nodet <gnodet@gmail.com>
Committed: Mon May 26 22:44:52 2014 +0200

----------------------------------------------------------------------
 .../java/org/apache/karaf/service/command/ListServices.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/9b4a050e/service/core/src/main/java/org/apache/karaf/service/command/ListServices.java
----------------------------------------------------------------------
diff --git a/service/core/src/main/java/org/apache/karaf/service/command/ListServices.java
b/service/core/src/main/java/org/apache/karaf/service/command/ListServices.java
index caf546b..aed352e 100644
--- a/service/core/src/main/java/org/apache/karaf/service/command/ListServices.java
+++ b/service/core/src/main/java/org/apache/karaf/service/command/ListServices.java
@@ -122,9 +122,10 @@ public class ListServices implements Action {
         String bundleName = ShellUtil.getBundleName(serviceRef.getBundle());
         System.out.println("Provided by : ");
         System.out.println(" " + bundleName);
-        if (serviceRef.getUsingBundles() != null) {
-        System.out.println("Used by: ");
-            for (Bundle bundle : serviceRef.getUsingBundles()) {
+        Bundle[] usingBundles = serviceRef.getUsingBundles();
+        if (usingBundles != null) {
+            System.out.println("Used by: ");
+            for (Bundle bundle : usingBundles) {
                 System.out.println(" " + ShellUtil.getBundleName(bundle));
             }
         }


Mime
View raw message