From 40dfa8c0495dc904aa254afca85000e52ae110da Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Fri, 4 Nov 2022 18:50:47 +0000 Subject: [PATCH] Check schema exists for default value --- packages/client/src/components/app/forms/InnerForm.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/app/forms/InnerForm.svelte b/packages/client/src/components/app/forms/InnerForm.svelte index 0c512bbe0f..00bcf19548 100644 --- a/packages/client/src/components/app/forms/InnerForm.svelte +++ b/packages/client/src/components/app/forms/InnerForm.svelte @@ -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