Be even more explicit about expecting an array data type for data provider rows

This commit is contained in:
Andrew Kingston 2021-11-15 12:26:13 +00:00
parent 9b05990418
commit 1b4e95ed3c
1 changed files with 1 additions and 1 deletions

View File

@ -188,7 +188,7 @@
// Field sources will be available from context. // Field sources will be available from context.
// Enrich non object elements into object to ensure a valid schema. // Enrich non object elements into object to ensure a valid schema.
const data = dataSource?.value || [] 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 })) allRows = data.map(value => ({ value }))
} else { } else {
allRows = data allRows = data