You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by cs...@apache.org on 2018/09/27 13:37:53 UTC

[aries-rsa] branch master updated: ARIES-1788 - Skip service if it is null

This is an automated email from the ASF dual-hosted git repository.

cschneider pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-rsa.git


The following commit(s) were added to refs/heads/master by this push:
     new 17c32cb  ARIES-1788 - Skip service if it is null
17c32cb is described below

commit 17c32cb0c9c58c258c9efa5484d43504ab42cd83
Author: Christian Schneider <cs...@adobe.com>
AuthorDate: Thu Sep 27 15:37:34 2018 +0200

    ARIES-1788 - Skip service if it is null
---
 .../java/org/apache/aries/rsa/core/DistributionProviderTracker.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/rsa/src/main/java/org/apache/aries/rsa/core/DistributionProviderTracker.java b/rsa/src/main/java/org/apache/aries/rsa/core/DistributionProviderTracker.java
index 1477e4c..a2d1192 100644
--- a/rsa/src/main/java/org/apache/aries/rsa/core/DistributionProviderTracker.java
+++ b/rsa/src/main/java/org/apache/aries/rsa/core/DistributionProviderTracker.java
@@ -47,8 +47,12 @@ public class DistributionProviderTracker extends ServiceTracker<DistributionProv
 
     @Override
     public ServiceRegistration addingService(ServiceReference<DistributionProvider> reference) {
-        LOG.debug("RemoteServiceAdmin Implementation is starting up");
         DistributionProvider provider = context.getService(reference);
+        if (provider == null) {
+            // Can happen if the service is created by a service factory and an exception occurs
+            return null;
+        }
+        LOG.debug("RemoteServiceAdmin Implementation is starting up");
         BundleContext apiContext = getAPIContext();
         PackageUtil packageUtil = new PackageUtil(context);
         EventProducer eventProducer = new EventProducer(context);