From 1b5ac7415096fa3653d0ac5a3c01e25fc11ccf29 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 26 Feb 2021 09:55:38 +0000 Subject: [PATCH] Fix crash when schema doesnt exist for a datasource --- packages/builder/src/builderStore/dataBinding.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 429ba1c683..dee0b86fb3 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -120,7 +120,7 @@ const getContextBindings = (asset, componentId) => { tableName = info.table?.name // Add _id and _rev fields for certain types - if (datasource.type === "table" || datasource.type === "link") { + if (schema && ["table", "link"].includes(datasource.type)) { schema["_id"] = { type: "string" } schema["_rev"] = { type: "string" } }