🐛 Protect against syncing with a not existing component

This commit is contained in:
Andrés Moya 2021-01-22 14:36:22 +01:00
parent e4eaa74b51
commit b0ea9d3096

View file

@ -476,14 +476,16 @@
root-inst shape-inst root-inst shape-inst
root-master (cp/get-component-root component)] root-master (cp/get-component-root component)]
(generate-sync-shape-direct-recursive container (if component
shape-inst (generate-sync-shape-direct-recursive container
component shape-inst
shape-master component
root-inst shape-master
root-master root-inst
reset? root-master
initial-root?))) reset?
initial-root?)
empty-changes)))
(defn- generate-sync-shape-direct-recursive (defn- generate-sync-shape-direct-recursive
[container shape-inst component shape-master root-inst root-master reset? initial-root?] [container shape-inst component shape-master root-inst root-master reset? initial-root?]
@ -591,13 +593,15 @@
root-inst shape-inst root-inst shape-inst
root-master (cp/get-component-root component)] root-master (cp/get-component-root component)]
(generate-sync-shape-inverse-recursive container (if component
shape-inst (generate-sync-shape-inverse-recursive container
component shape-inst
shape-master component
root-inst shape-master
root-master root-inst
initial-root?))) root-master
initial-root?)
empty-changes)))
(defn- generate-sync-shape-inverse-recursive (defn- generate-sync-shape-inverse-recursive
[container shape-inst component shape-master root-inst root-master initial-root?] [container shape-inst component shape-master root-inst root-master initial-root?]