From 5502f317ad846dfec74b313fcf7d085078920c3f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 9 Jan 2024 23:10:14 +0100 Subject: [PATCH] :bug: Fix unexpected exception on incorrect thumbnail gen of root shape --- common/src/app/common/files/helpers.cljc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/src/app/common/files/helpers.cljc b/common/src/app/common/files/helpers.cljc index 701575583..01507eea0 100644 --- a/common/src/app/common/files/helpers.cljc +++ b/common/src/app/common/files/helpers.cljc @@ -32,13 +32,17 @@ ([objects id] (is-direct-child-of-root? (get objects id))) ([shape] - (and (some? shape) (= (dm/get-prop shape :frame-id) uuid/zero)))) + (and (some? shape) + (= (dm/get-prop shape :frame-id) uuid/zero)))) (defn root-frame? ([objects id] - (root-frame? (get objects id))) + (if (= id uuid/zero) + false + (root-frame? (get objects id)))) ([shape] (and (some? shape) + (not= (dm/get-prop shape :id) uuid/zero) (= (dm/get-prop shape :type) :frame) (= (dm/get-prop shape :frame-id) uuid/zero))))