From fcb0d6667488f49ac1af416b4e3418d13a8cec5c Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Thu, 26 May 2022 13:00:19 +0100 Subject: [PATCH] Make sure linkedRows is an array before map --- .../builder/src/components/common/LinkedRowSelector.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/common/LinkedRowSelector.svelte b/packages/builder/src/components/common/LinkedRowSelector.svelte index 592ee47565..5c49c17560 100644 --- a/packages/builder/src/components/common/LinkedRowSelector.svelte +++ b/packages/builder/src/components/common/LinkedRowSelector.svelte @@ -8,7 +8,9 @@ export let linkedRows = [] let rows = [] - let linkedIds = (linkedRows || [])?.map(row => row?._id || row) + let linkedIds = (Array.isArray(linkedRows) ? linkedRows : [])?.map( + row => row?._id || row + ) $: linkedRows = linkedIds $: label = capitalise(schema.name)