From e18aa94534cbdde702be83ac67c9d023a646a760 Mon Sep 17 00:00:00 2001 From: rfeng Date: Thu, 30 Jul 2009 23:48:54 +0000 Subject: Check null to avoid NPE git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@799473 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/endpoint/impl/EndpointRegistryImpl.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'java/sca/modules/endpoint') 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 localEndpoints = endpoints.remove(this); - for (Endpoint endpoint : localEndpoints) { - removeEndpoint(endpoint); + if (localEndpoints != null) { + for (Endpoint endpoint : localEndpoints) { + removeEndpoint(endpoint); + } } List localEndpointReferences = endpointreferences.remove(this); - for (EndpointReference endpointReference : localEndpointReferences) { - removeEndpointReference(endpointReference); + if (localEndpointReferences != null) { + for (EndpointReference endpointReference : localEndpointReferences) { + removeEndpointReference(endpointReference); + } } listeners.clear(); } -- cgit v1.2.3