Fix frontend crashing when adding components to a data provider component with no source
This commit is contained in:
parent
d24679bc33
commit
ee6c210e67
|
@ -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…
Reference in New Issue