From 223a82f71746ada05e186a362f860b2906626b1c Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 9 Nov 2023 11:07:32 +0000 Subject: [PATCH] Ensure metadata is not null before registering datasources for automatic hot reloading --- .../client/src/components/context/Provider.svelte | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/client/src/components/context/Provider.svelte b/packages/client/src/components/context/Provider.svelte index 19a5c3a462..3fffaaf7fa 100644 --- a/packages/client/src/components/context/Provider.svelte +++ b/packages/client/src/components/context/Provider.svelte @@ -45,12 +45,13 @@ // Register any "refresh datasource" actions with a singleton store // so we can easily refresh data at all levels for any datasource if (type === ActionTypes.RefreshDatasource) { - const { dataSource } = metadata || {} - dataSourceStore.actions.registerDataSource( - dataSource, - instanceId, - callback - ) + if (metadata?.dataSource) { + dataSourceStore.actions.registerDataSource( + metadata.dataSource, + instanceId, + callback + ) + } } }) }