Check schema exists for default value
This commit is contained in:
parent
e6ebd869f1
commit
32f7843e55
1 changed files with 1 additions and 1 deletions
|
@ -131,7 +131,7 @@
|
||||||
const getDefault = (defaultValue, schema, type) => {
|
const getDefault = (defaultValue, schema, type) => {
|
||||||
// Remove any values not present in the field schema
|
// Remove any values not present in the field schema
|
||||||
// Convert any values supplied to string
|
// Convert any values supplied to string
|
||||||
if (Array.isArray(defaultValue) && type == "array") {
|
if (Array.isArray(defaultValue) && type == "array" && schema) {
|
||||||
return defaultValue.reduce((acc, entry) => {
|
return defaultValue.reduce((acc, entry) => {
|
||||||
let processedOption = String(entry)
|
let processedOption = String(entry)
|
||||||
let schemaOptions = schema.constraints.inclusion
|
let schemaOptions = schema.constraints.inclusion
|
||||||
|
|
Loading…
Reference in a new issue