From a87d457ffd2a02680b69d2276f9cbeefdc6e76fd Mon Sep 17 00:00:00 2001 From: edwardsmj Date: Fri, 29 May 2009 14:24:28 +0000 Subject: Fix for unguarded access to compositeActivator.getDomainComposite() in stop() method of NodeImpl which causes NPE in situations where start() completes with ContributionReadException (and similar error exceptions) git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@779992 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tuscany/sca/node/impl/NodeImpl.java | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java index 8a24593c1a..acd2d91db9 100644 --- a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java +++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java @@ -103,17 +103,19 @@ public class NodeImpl implements Node, Client { return; } NodeFinder.removeNode(NodeUtil.createURI(configuration.getDomainURI())); - List composites = compositeActivator.getDomainComposite().getIncludes(); - for (Composite composite : composites) { - - // Stop the composite - compositeActivator.stop(composite); - - // Deactivate the composite - compositeActivator.deactivate(composite); - - } - composites.clear(); + if( compositeActivator.getDomainComposite() != null ) { + List composites = compositeActivator.getDomainComposite().getIncludes(); + for (Composite composite : composites) { + + // Stop the composite + compositeActivator.stop(composite); + + // Deactivate the composite + compositeActivator.deactivate(composite); + + } // end for + composites.clear(); + } // end if manager.removeNode(configuration); this.compositeActivator = null; -- cgit v1.2.3