🐛 Fix unexpected output on get-page when invalid object-id is provided

This commit is contained in:
Andrey Antukh 2023-08-23 11:39:08 +02:00 committed by Alejandro Alonso
parent 159ac92021
commit ddbc828342
2 changed files with 6 additions and 1 deletions

View file

@ -498,7 +498,8 @@
other not needed objects removed from the `:objects` data
structure."
[{:keys [objects] :as page} object-id]
(let [objects (cph/get-children-with-self objects object-id)]
(let [objects (->> (cph/get-children-with-self objects object-id)
(filter some?))]
(assoc page :objects (d/index-by :id objects))))
(defn- prune-thumbnails