commit | 2a5dce3050b05db92d3973e7fba395934638bb09 | [log] [tgz] |
---|---|---|
author | A. J. David Bosschaert <davidb@apache.org> | Wed Jun 10 10:32:46 2015 +0000 |
committer | A. J. David Bosschaert <davidb@apache.org> | Wed Jun 10 10:32:46 2015 +0000 |
tree | 2f40df364dfe1a3138521728438a35e7791d3e05 | |
parent | d86501e3e23ce69e6b3ab487b00a0bca43b022dc [diff] |
Add defensive null check. git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1684635 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java b/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java index 16ab677..e23f640 100644 --- a/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java +++ b/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java
@@ -419,7 +419,8 @@ { 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)