From b0ea9d3096e75e06da25a0b62b514c71e29c83f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Fri, 22 Jan 2021 14:36:22 +0100 Subject: [PATCH] :bug: Protect against syncing with a not existing component --- .../data/workspace/libraries_helpers.cljs | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/frontend/src/app/main/data/workspace/libraries_helpers.cljs b/frontend/src/app/main/data/workspace/libraries_helpers.cljs index 895521856..9538498ad 100644 --- a/frontend/src/app/main/data/workspace/libraries_helpers.cljs +++ b/frontend/src/app/main/data/workspace/libraries_helpers.cljs @@ -476,14 +476,16 @@ root-inst shape-inst root-master (cp/get-component-root component)] - (generate-sync-shape-direct-recursive container - shape-inst - component - shape-master - root-inst - root-master - reset? - initial-root?))) + (if component + (generate-sync-shape-direct-recursive container + shape-inst + component + shape-master + root-inst + root-master + reset? + initial-root?) + empty-changes))) (defn- generate-sync-shape-direct-recursive [container shape-inst component shape-master root-inst root-master reset? initial-root?] @@ -591,13 +593,15 @@ root-inst shape-inst root-master (cp/get-component-root component)] - (generate-sync-shape-inverse-recursive container - shape-inst - component - shape-master - root-inst - root-master - initial-root?))) + (if component + (generate-sync-shape-inverse-recursive container + shape-inst + component + shape-master + root-inst + root-master + initial-root?) + empty-changes))) (defn- generate-sync-shape-inverse-recursive [container shape-inst component shape-master root-inst root-master initial-root?]