From 771411734959268ed9c77752bc150b09d3e43e9e Mon Sep 17 00:00:00 2001 From: MarkXian Date: Tue, 23 Jun 2026 15:48:45 +0800 Subject: [PATCH] Fix: guard against null line_model in distance.element position setter The position setter passed line_model straight to the styleProps setter and render(), both of which destructure it. When line_model is null or undefined (e.g. during rapid mouse movement or when measured elements unmount in SPAs), this threw a TypeError. Bail out early when line_model is falsy. Fixes #686 --- app/components/selection/distance.element.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/components/selection/distance.element.js b/app/components/selection/distance.element.js index 36a68e89..8423d7fb 100644 --- a/app/components/selection/distance.element.js +++ b/app/components/selection/distance.element.js @@ -17,6 +17,8 @@ export class Distance extends HTMLElement { } set position({line_model, node_label_id}) { + if (!line_model) return + this.styleProps = line_model this.$shadow.innerHTML = this.render(line_model, node_label_id) }