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