1
0
Fork 0
mirror of synced 2024-10-04 12:03:31 +13:00

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

This commit is contained in:
Andrew Kingston 2020-10-08 09:48:03 +01:00
parent d24679bc33
commit ee6c210e67

View file

@ -78,6 +78,11 @@ const contextToBindables = (models, walkResult) => context => {
typeof context.model === "string" ? context.model : context.model.modelId typeof context.model === "string" ? context.model : context.model.modelId
const model = models.find(model => model._id === 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 => ({ const newBindable = key => ({
type: "context", type: "context",
instance: context.instance, instance: context.instance,