Fix crash with dynamic filter when using custom data source

This commit is contained in:
Andrew Kingston 2024-02-27 13:51:36 +00:00
parent 92d8dc14a1
commit 32b0aa34b8
1 changed files with 3 additions and 3 deletions

View File

@ -58,13 +58,13 @@
}
let clonedSchema = {}
if (!allowedFields?.length) {
clonedSchema = schema
clonedSchema = schema || {}
} else {
allowedFields?.forEach(field => {
if (schema[field.name]) {
if (schema?.[field.name]) {
clonedSchema[field.name] = schema[field.name]
clonedSchema[field.name].displayName = field.displayName
} else if (schema[field]) {
} else if (schema?.[field]) {
clonedSchema[field] = schema[field]
}
})