Description
In app/components/selection/distance.element.js, the position setter directly passes line_model to this.styleProps and this.render() without verifying if line_model exists.
If line_model is unexpectedly passed as null or undefined (which can happen during rapid mouse movements or when elements dynamically unmount in modern single-page applications), the application will crash with a TypeError during object destructuring in downstream setters/methods.
Code Location
In app/components/selection/distance.element.js:
set position ({ line_model, node_label_id }) {
this.styleProps = line_model
this.$shadow.innerHTML = this.render(line_model, node_label_id)
}
Suggested Fix
Add a guard clause at the beginning of the position setter to gracefully exit if line_model is falsy:
JavaScript
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)
}
Description
In
app/components/selection/distance.element.js, thepositionsetter directly passesline_modeltothis.stylePropsandthis.render()without verifying ifline_modelexists.If
line_modelis unexpectedly passed asnullorundefined(which can happen during rapid mouse movements or when elements dynamically unmount in modern single-page applications), the application will crash with aTypeErrorduring object destructuring in downstream setters/methods.Code Location
In
app/components/selection/distance.element.js: