fix: safe check dom blockid

This commit is contained in:
Tienson Qin
2025-09-18 20:48:00 +08:00
parent abd1d070f5
commit 0832f0b7d7

View File

@@ -1147,7 +1147,7 @@
(let [dom-blocks (remove (fn [block] (= "true" (dom/attr block "data-query"))) blocks)]
(when (seq dom-blocks)
(let [repo (state/get-current-repo)
block-uuids (distinct (map #(uuid (dom/attr % "blockid")) dom-blocks))
block-uuids (distinct (keep #(when-let [id (dom/attr % "blockid")] (uuid id)) dom-blocks))
lookup-refs (map (fn [id] [:block/uuid id]) block-uuids)
blocks (map db/entity lookup-refs)]
(ui-outliner-tx/transact!