0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 23:18:48 -05:00

🐛 Fix components without root shape for v2 migration

This commit is contained in:
Alejandro Alonso 2024-02-09 12:25:47 +01:00 committed by Andrés Moya
parent 9f6b82dfc0
commit dc67056a8c

View file

@ -431,9 +431,11 @@
fix-empty-components
(fn [file-data]
(letfn [(fix-component [components id component]
(if (empty? (:objects component))
(dissoc components id)
components))]
(let [root-shape (ctst/get-shape component (:id component))]
(if (or (empty? (:objects component))
(nil? root-shape))
(dissoc components id)
components)))]
(-> file-data
(d/update-when :components #(reduce-kv fix-component % %)))))