summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-09-20 12:46:01 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-09-20 12:46:01 +0000
commit8c441278d16941de1ee077ddd18f6b58f14bfe2f (patch)
treeb70f5060a4c87a160c35a8aca7bedf1f245478a0 /sca-java-2.x/trunk
parentb14ca8bfe8c97e2269296e92b28f90c84c466218 (diff)
Avoid NPE when no port location defined
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1173122 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2EngineIntegration.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2EngineIntegration.java b/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2EngineIntegration.java
index e25f5768e5..244135c900 100644
--- a/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2EngineIntegration.java
+++ b/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2EngineIntegration.java
@@ -531,12 +531,15 @@ public class Axis2EngineIntegration {
//=========================================================
public static String getPortAddress(Port port) {
- Object ext = port.getExtensibilityElements().get(0);
- if (ext instanceof SOAPAddress) {
- return ((SOAPAddress)ext).getLocationURI();
- }
- if (ext instanceof SOAP12Address) {
- return ((SOAP12Address)ext).getLocationURI();
+ List<?> es = port.getExtensibilityElements();
+ if (es != null && es.size() > 0) {
+ Object ext = es.get(0);
+ if (ext instanceof SOAPAddress) {
+ return ((SOAPAddress)ext).getLocationURI();
+ }
+ if (ext instanceof SOAP12Address) {
+ return ((SOAP12Address)ext).getLocationURI();
+ }
}
return null;
}