summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-07-30 23:48:54 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-07-30 23:48:54 +0000
commite18aa94534cbdde702be83ac67c9d023a646a760 (patch)
treea036924a6ff7dd11d128a96952c516babcce4613 /java/sca
parent1a6c59e5a31989365ba114b80bd017cd18dd770d (diff)
Check null to avoid NPE
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@799473 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
-rw-r--r--java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointRegistryImpl.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointRegistryImpl.java b/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointRegistryImpl.java
index fbd8aea438..8e51068793 100644
--- a/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointRegistryImpl.java
+++ b/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointRegistryImpl.java
@@ -200,12 +200,16 @@ public class EndpointRegistryImpl implements EndpointRegistry, LifeCycleListener
public void stop() {
List<Endpoint> localEndpoints = endpoints.remove(this);
- for (Endpoint endpoint : localEndpoints) {
- removeEndpoint(endpoint);
+ if (localEndpoints != null) {
+ for (Endpoint endpoint : localEndpoints) {
+ removeEndpoint(endpoint);
+ }
}
List<EndpointReference> localEndpointReferences = endpointreferences.remove(this);
- for (EndpointReference endpointReference : localEndpointReferences) {
- removeEndpointReference(endpointReference);
+ if (localEndpointReferences != null) {
+ for (EndpointReference endpointReference : localEndpointReferences) {
+ removeEndpointReference(endpointReference);
+ }
}
listeners.clear();
}