Skip to content

Commit

Permalink
fix: call foreach of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
visiky committed Jun 15, 2022
1 parent 68eeafa commit 17c146d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/component/update-label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function updateLabel(fromShape: IGroup, toShape: IGroup, cfg: Cfg): void
fromShape.set('coordinate', coordinate);
fromShape.set('visible', toShape.get('visible'));

fromShape.getChildren().forEach((fromChild, idx) => {
(fromShape.getChildren() || []).forEach((fromChild, idx) => {
const toChild = toShape.getChildByIndex(idx) as IShape;
if (!toChild) {
fromShape.removeChild(fromChild);
Expand Down

0 comments on commit 17c146d

Please sign in to comment.