summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-03-16 10:27:16 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-03-16 10:27:16 +0000
commit121b1269dedae1e8d4843668e82d3c86960b46eb (patch)
treec3c9234c7513c833b9111017b2a2544a9a824711
parent133ec9e681a23609db5fa32c1529e0bb363ebb36 (diff)
Be a bit more careful about dereferencing the DomainRegistryFactory endpointRegistries collection.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1082114 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java
index 1186da72f0..87b8da62a9 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AsyncResponseInvoker.java
@@ -337,11 +337,15 @@ public class AsyncResponseInvoker<T> implements InvokerAsyncResponse, Serializab
} // end for
} // end if
- // if there was no domainName to match, simply return the first EndpointRegistry...
- EndpointRegistry endpointRegistry = (EndpointRegistry) domainRegistryFactory.getEndpointRegistries().toArray()[0];
+ // if there was no domainName to match, simply return the first EndpointRegistry if there is one...
+
+ if (domainRegistryFactory.getEndpointRegistries().size() > 0){
+ EndpointRegistry endpointRegistry = (EndpointRegistry) domainRegistryFactory.getEndpointRegistries().toArray()[0];
+ return endpointRegistry;
+ } else {
+ return null;
+ }
-
- return endpointRegistry;
} // end method
} // end class