From 1bcfd44d79aff347c08809a5555171cd490d6431 Mon Sep 17 00:00:00 2001 From: antelder Date: Mon, 11 Aug 2008 06:44:29 +0000 Subject: Protect against NPE when the InterfaceCOntract is also null git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@684646 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/core/assembly/CompositeActivatorImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'java/sca/modules/core/src/main') diff --git a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java index d205cbf823..6eb5f0d1e5 100644 --- a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java +++ b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java @@ -412,8 +412,14 @@ public class CompositeActivatorImpl implements CompositeActivator { // Use the interface contract of the reference on the component type Reference componentTypeRef = reference.getReference(); - InterfaceContract sourceContract = - componentTypeRef == null ? reference.getInterfaceContract() : componentTypeRef.getInterfaceContract(); + + InterfaceContract sourceContract; + if (componentTypeRef == null || componentTypeRef.getInterfaceContract() == null) { + sourceContract = reference.getInterfaceContract(); + } else { + sourceContract = componentTypeRef.getInterfaceContract(); + } + sourceContract = sourceContract.makeUnidirectional(false); EndpointReference wireSource = -- cgit v1.2.3