From 2c14b2193d21088ce9362c71eb64b517a6b226bb Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 2 May 2022 21:01:20 -0500 Subject: [PATCH] Fix links sometimes using nodes that were removed --- src/features/links/Links.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/features/links/Links.vue b/src/features/links/Links.vue index eccd7be..b5d7c1f 100644 --- a/src/features/links/Links.vue +++ b/src/features/links/Links.vue @@ -43,9 +43,9 @@ function updateNodes() { isDirty = false; nextTick(() => { boundingRect.value = resizeListener.value?.getBoundingClientRect(); - (Object.values(nodes.value) as FeatureNode[]).forEach( - node => (node.rect = node.element.getBoundingClientRect()) - ); + (Object.values(nodes.value) as FeatureNode[]) + .filter(n => n) // Sometimes the values become undefined + .forEach(node => (node.rect = node.element.getBoundingClientRect())); isDirty = true; }); }