From 7465a5e1e9ca891d0f018b4416bf25a15266729c Mon Sep 17 00:00:00 2001 From: Jarek Danielak Date: Thu, 9 Jan 2025 14:12:52 +0100 Subject: [PATCH] fix(core/GrahicsFactory): account for removed shapes on updateContainments Related to https://github.com/bpmn-io/bpmn-js/issues/2269 --- lib/core/GraphicsFactory.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/core/GraphicsFactory.js b/lib/core/GraphicsFactory.js index 19e189078..9f2d3f6a6 100644 --- a/lib/core/GraphicsFactory.js +++ b/lib/core/GraphicsFactory.js @@ -192,6 +192,11 @@ GraphicsFactory.prototype.updateContainments = function(elements) { forEach(children.slice().reverse(), function(child) { var childGfx = elementRegistry.getGraphics(child); + // shape was removed + if (!childGfx) { + return; + } + prependTo(childGfx.parentNode, childrenGfx); }); });