🐛 Fix validation of shadow token with missing keys (#8507)

This commit is contained in:
Andrés Moya 2026-03-02 16:17:12 +01:00 committed by GitHub
parent 7066afa01a
commit 31478c6afc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View File

@ -32,6 +32,7 @@
- Fix viewer can update library [Taiga #13186](https://tree.taiga.io/project/penpot/issue/13186)
- Fix remove fill affects different element than selected [Taiga #13128](https://tree.taiga.io/project/penpot/issue/13128)
- Fix cannot apply second token after creation while shape is selected [Taiga #13513](https://tree.taiga.io/project/penpot/issue/13513)
- Fix error activating a set with invalid shadow token applied [Taiga #13528](https://tree.taiga.io/project/penpot/issue/13528)
## 2.13.3

View File

@ -377,7 +377,15 @@
(defn- parse-single-shadow
"Parses a single shadow map with properties: x, y, blur, spread, color, type."
[shadow-map shadow-index]
(let [add-keyed-errors (fn [shadow-result k errors]
(let [shadow-map (merge {:offset-x nil ;; Ensure that all keys are processed, even if missing in the original token
:offset-y nil
:blur nil
:spread nil
:color nil
:inset false}
shadow-map)
add-keyed-errors (fn [shadow-result k errors]
(update shadow-result :errors concat
(map #(assoc % :shadow-key k :shadow-index shadow-index) errors)))
parsers {:offset-x parse-sd-token-general-value