camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] camel git commit: Avoid potential NPE such as when using camel-test-blueprint
Date Sat, 03 Oct 2015 07:46:38 GMT
Repository: camel
Updated Branches:
  refs/heads/master 0f5e3afb4 -> d5f0aefdf


Avoid potential NPE such as when using camel-test-blueprint


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

Branch: refs/heads/master
Commit: ec464604b0f9f9dc01b3821a3c6f83ea1769b204
Parents: 0f5e3af
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sat Oct 3 09:30:28 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sat Oct 3 09:30:28 2015 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/camel/impl/osgi/Activator.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ec464604/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java b/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
index f0e584c..e7d3da3 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
@@ -242,11 +242,13 @@ public class Activator implements BundleActivator, BundleTrackerCustomizer
{
             return true;
         }
         BundleCapability packageCap = packageCapabilities.get(clazz.getPackage().getName());
-        BundleWiring wiring = bundle.adapt(BundleWiring.class);
-        List<BundleWire> imports = wiring.getRequiredWires(PACKAGE_NAMESPACE);
-        for (BundleWire importWire : imports) {
-            if (packageCap.equals(importWire.getCapability())) {
-                return true;
+        if (packageCap != null) {
+            BundleWiring wiring = bundle.adapt(BundleWiring.class);
+            List<BundleWire> imports = wiring.getRequiredWires(PACKAGE_NAMESPACE);
+            for (BundleWire importWire : imports) {
+                if (packageCap.equals(importWire.getCapability())) {
+                    return true;
+                }
             }
         }
         return false;


Mime
View raw message