From f6a388b38a1abcc7075cc89b2f561483b88944af Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 14 Oct 2020 09:39:49 +0100 Subject: [PATCH] Fix errors being thrown when nesting certain components without picking a datasource --- packages/standard-components/src/Form.svelte | 2 +- packages/standard-components/src/NewRow.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/standard-components/src/Form.svelte b/packages/standard-components/src/Form.svelte index ed9a393440..29401e8ad4 100644 --- a/packages/standard-components/src/Form.svelte +++ b/packages/standard-components/src/Form.svelte @@ -14,7 +14,7 @@ let rowId let errors = {} - $: schema = $store.data && $store.data._table.schema + $: schema = $store.data && $store.data._table && $store.data._table.schema $: fields = schema ? Object.keys(schema) : [] diff --git a/packages/standard-components/src/NewRow.svelte b/packages/standard-components/src/NewRow.svelte index 817e07e0d0..e7446f9bdc 100644 --- a/packages/standard-components/src/NewRow.svelte +++ b/packages/standard-components/src/NewRow.svelte @@ -19,7 +19,7 @@ } onMount(async () => { - if (table) { + if (table && typeof table === "string") { const tableObj = await fetchTable(table) row.tableId = table row._table = tableObj