1
0
Fork 0
mirror of synced 2024-06-01 18:20:18 +12:00

Check schema exists for default value

This commit is contained in:
Mel O'Hagan 2022-11-04 18:50:47 +00:00
parent 841b3b62c0
commit 40dfa8c049

View file

@ -131,7 +131,7 @@
const getDefault = (defaultValue, schema, type) => {
// Remove any values not present in the field schema
// Convert any values supplied to string
if (Array.isArray(defaultValue) && type == "array") {
if (Array.isArray(defaultValue) && type == "array" && schema) {
return defaultValue.reduce((acc, entry) => {
let processedOption = String(entry)
let schemaOptions = schema.constraints.inclusion