0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 14:12:36 -05:00

Fix exact match of diff adding nil attrs group and crashing the app

This commit is contained in:
Florian Schroedl 2024-08-01 10:41:03 +02:00
parent ac27f95091
commit 68b32448d1

View file

@ -66,14 +66,14 @@
(fn [acc [attrs v]] (fn [acc [attrs v]]
(cond (cond
(some attrs #{:rx :ry}) (let [[_ a b] (data/diff #{:rx :ry} attrs)] (some attrs #{:rx :ry}) (let [[_ a b] (data/diff #{:rx :ry} attrs)]
(assoc acc (cond-> (assoc acc b v)
a v ;; Exact match in attrs
b v)) a (assoc a v)))
(some attrs #{:widht :height}) (let [[_ a b] (data/diff #{:width :height} attrs)] (some attrs #{:widht :height}) (let [[_ a b] (data/diff #{:width :height} attrs)]
(assoc acc (cond-> (assoc acc b v)
a v ;; Exact match in attrs
b v)) a (assoc a v)))
(some attrs ctt/spacing-keys) (let [[_ rst gap] (data/diff #{:row-gap :column-gap} attrs) (some attrs ctt/spacing-keys) (let [[_ rst gap] (data/diff #{:row-gap :column-gap} attrs)
[_ position padding] (data/diff #{:p1 :p2 :p3 :p4} rst)] [_ position padding] (data/diff #{:p1 :p2 :p3 :p4} rst)]
(cond-> acc (cond-> acc