From 5f26440a006e03b413c1d3f71ba080e3a80fb388 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 3 Jan 2017 11:37:39 +0100 Subject: [PATCH] NodeAddChildrenAction: do nothing for missing node --- .../Businessprocess/Modification/NodeAddChildrenAction.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/Businessprocess/Modification/NodeAddChildrenAction.php b/library/Businessprocess/Modification/NodeAddChildrenAction.php index 77b7080..fdc70a4 100644 --- a/library/Businessprocess/Modification/NodeAddChildrenAction.php +++ b/library/Businessprocess/Modification/NodeAddChildrenAction.php @@ -31,6 +31,11 @@ class NodeAddChildrenAction extends NodeAction public function applyTo(BusinessProcess $bp) { /** @var BpNode $node */ + if (! $this->hasNode()) { + // TODO: We end up here when defining "top nodes", but that would probably + // be a different action + return $this; + } $node = $bp->getNode($this->getNodeName()); $existing = $node->getChildNames(); foreach ($this->children as $name) {