🐛 Fix error with empty curves

This commit is contained in:
alonso.torres 2023-03-15 09:25:52 +01:00
parent 2c6513ac85
commit 107d607d37
2 changed files with 21 additions and 15 deletions

View file

@ -49,7 +49,8 @@
(let [objects (wsh/lookup-page-objects state)
content (get-in state [:workspace-drawing :object :content] [])
position (gpt/point (get-in content [0 :params] nil))
start (get-in content [0 :params] nil)
position (when start (gpt/point start))
frame-id (ctst/top-nested-frame objects position)
flex-layout? (ctl/flex-layout? objects frame-id)
drop-index (when flex-layout? (gsl/get-drop-index frame-id objects position))]

View file

@ -112,6 +112,7 @@
(update command :params assoc :x x :y y))
(defn format-path [content]
(try
(let [result (make-array (count content))]
(reduce (fn [last-move current]
(let [point (upc/command->point current)
@ -128,4 +129,8 @@
last-move))
nil
content)
(.join ^js result "")))
(.join ^js result ""))
(catch :default err
(.error js/console err)
nil)))