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 2019/05/16 12:47:05 UTC
[aries-rsa] branch master updated: Add explicit
IllegalStateException in exportService when service object 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 b2325ce Add explicit IllegalStateException in exportService when service object is null
new 3d1b29f Merge pull request #28 from amichair/illegalstate
b2325ce is described below
commit b2325ce116ab53eead73bb80873b371088615da5
Author: Amichai Rothman <am...@amichais.net>
AuthorDate: Tue May 14 12:06:39 2019 +0300
Add explicit IllegalStateException in exportService when service object is null
---
.../main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java b/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java
index 40c3f93..d48283c 100644
--- a/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java
+++ b/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java
@@ -225,6 +225,9 @@ public class RemoteServiceAdminCore implements RemoteServiceAdmin {
}
final BundleContext serviceContext = serviceBundle.getBundleContext();
final Object serviceO = serviceContext.getService(serviceReference);
+ if (serviceO == null) {
+ throw new IllegalStateException("service object is null (service was unregistered?)");
+ }
final Class<?>[] interfaces = getInterfaces(serviceO, interfaceNames);
final Map<String, Object> eprops = createEndpointProps(serviceProperties, interfaces);