You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2008/08/11 08:44:31 UTC

svn commit: r684646 - /tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java

Author: antelder
Date: Sun Aug 10 23:44:29 2008
New Revision: 684646

URL: http://svn.apache.org/viewvc?rev=684646&view=rev
Log:
Protect against NPE when the InterfaceCOntract is also null

Modified:
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java

Modified: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java?rev=684646&r1=684645&r2=684646&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java (original)
+++ tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java Sun Aug 10 23:44:29 2008
@@ -412,8 +412,14 @@
 
         // 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 =