🐛 Prevent NPE on get-points

This commit is contained in:
Andrey Antukh 2025-04-28 11:26:04 +02:00
parent 122e5a4b57
commit 4e3abcbd45
2 changed files with 10 additions and 3 deletions

View file

@ -272,7 +272,8 @@
hover-handlers
hover-points
snap-toggled]
:as edit-path} (mf/deref edit-path-ref)
:as edit-path}
(mf/deref edit-path-ref)
selected-points (or selected-points #{})
shape (hooks/use-equal-memo shape)
@ -282,7 +283,7 @@
base-points
(mf/with-memo [base-content]
(path.segment/get-points base-content))
(path/get-points base-content))
content
(mf/with-memo [base-content content-modifiers]
@ -290,7 +291,7 @@
content-points
(mf/with-memo [content]
(path.segment/get-points content))
(path/get-points content))
point->base (->> (map hash-map content-points base-points) (reduce merge))
base->point (map-invert point->base)