Browse Source

Fix frontend crashing when adding components to a data provider component with no source

pull/4023/head
Andrew Kingston 6 years ago
parent
commit
ee6c210e67
  1. 5
      packages/builder/src/builderStore/fetchBindableProperties.js

5
packages/builder/src/builderStore/fetchBindableProperties.js

@ -78,6 +78,11 @@ const contextToBindables = (models, walkResult) => context => {
typeof context.model === "string" ? context.model : context.model.modelId
const model = models.find(model => model._id === modelId)
// Avoid crashing whenever no data source has been selected
if (model == null) {
return []
}
const newBindable = key => ({
type: "context",
instance: context.instance,

Loading…
Cancel
Save