felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1684635 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java
Date Wed, 10 Jun 2015 10:32:46 GMT
Author: davidb
Date: Wed Jun 10 10:32:46 2015
New Revision: 1684635

URL: http://svn.apache.org/r1684635
Log:
Add defensive null check.

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java?rev=1684635&r1=1684634&r2=1684635&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java Wed
Jun 10 10:32:46 2015
@@ -419,7 +419,8 @@ public class ServiceRegistry
             {
                 if (count == 0)
                 {
-                    Object svc = usage.m_svcHolderRef.getAndSet(null).m_service;
+                    ServiceHolder holder = usage.m_svcHolderRef.getAndSet(null);
+                    Object svc = holder != null ? holder.m_service : null;
 
                     // Remove reference from usages array.
                     ((ServiceRegistrationImpl.ServiceReferenceImpl) ref)



Mime
View raw message