From ddbc8283427922046c0c7471663f24cfffb4b3e6 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 23 Aug 2023 11:39:08 +0200 Subject: [PATCH] :bug: Fix unexpected output on get-page when invalid object-id is provided --- CHANGES.md | 4 ++++ backend/src/app/rpc/commands/files.clj | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index a64458248..7d009faa5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,10 @@ - Navigate up in layer hierarchy with Shift+Enter shortcut [Taiga #5734](https://tree.taiga.io/project/penpot/us/5734) - Click on the flow tags open viewer with the selected frame [Taiga #5044](https://tree.taiga.io/project/penpot/us/5044) +### :bug: Bugs fixed + +- Fix unexpected output on get-page rpc method when invalid object-id is provided [Github #3546](https://github.com/penpot/penpot/issues/3546) + ## 1.19.1 ### :bug: Bugs fixed diff --git a/backend/src/app/rpc/commands/files.clj b/backend/src/app/rpc/commands/files.clj index 83cbfed23..54fb909ad 100644 --- a/backend/src/app/rpc/commands/files.clj +++ b/backend/src/app/rpc/commands/files.clj @@ -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