From 1b4e95ed3c9419b44eb8a14d8051d1dd53a7aa73 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 15 Nov 2021 12:26:13 +0000 Subject: [PATCH] Be even more explicit about expecting an array data type for data provider rows --- packages/client/src/components/app/DataProvider.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/app/DataProvider.svelte b/packages/client/src/components/app/DataProvider.svelte index 0b9cbac4dd..68f6cc6c07 100644 --- a/packages/client/src/components/app/DataProvider.svelte +++ b/packages/client/src/components/app/DataProvider.svelte @@ -188,7 +188,7 @@ // Field sources will be available from context. // Enrich non object elements into object to ensure a valid schema. const data = dataSource?.value || [] - if (data[0] && typeof data[0] !== "object") { + if (Array.isArray(data) && data[0] && typeof data[0] !== "object") { allRows = data.map(value => ({ value })) } else { allRows = data