Ensure metadata is not null before registering datasources for automatic hot reloading

This commit is contained in:
Andrew Kingston 2023-11-09 11:07:32 +00:00
parent 6b7e410f0d
commit 223a82f717
1 changed files with 7 additions and 6 deletions

View File

@ -45,13 +45,14 @@
// Register any "refresh datasource" actions with a singleton store // Register any "refresh datasource" actions with a singleton store
// so we can easily refresh data at all levels for any datasource // so we can easily refresh data at all levels for any datasource
if (type === ActionTypes.RefreshDatasource) { if (type === ActionTypes.RefreshDatasource) {
const { dataSource } = metadata || {} if (metadata?.dataSource) {
dataSourceStore.actions.registerDataSource( dataSourceStore.actions.registerDataSource(
dataSource, metadata.dataSource,
instanceId, instanceId,
callback callback
) )
} }
}
}) })
} }
} }