Fix undefined from Array.find on element neighbors
Closes #338 (closed)
The exact cause on this issue is undefined, both literally and figuratively. Array.prototype.find
returns undefined
when nothing is found, so this means the element was not in its own neighbors, which should not happen at least on the backend side. The Sentry issue occurred while deleting an element, so we can safely assume that during the deletion, the elementId
property got updated, causing an update on this computed property, possibly causing a situation where the element neighbors were not the element neighbors of this element ID, so the element was not found and all hell broke loose.
This is something that would not occur with a simple object like in elementsv2
, with neighbors: { [childId]: { ... } }
; see #222 (closed).