diff options
author | edwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-29 14:24:28 +0000 |
---|---|---|
committer | edwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-29 14:24:28 +0000 |
commit | a87d457ffd2a02680b69d2276f9cbeefdc6e76fd (patch) | |
tree | 0a9c39d283f4e957af3864256cdea6a634aa9cf4 /java | |
parent | e2d83e07887456774ff7cd450843d2a229060716 (diff) |
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
Diffstat (limited to 'java')
-rw-r--r-- | java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java | 24 |
1 files 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<Composite> 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<Composite> 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; |