From af7a2e8401a63d07924a03e5449bddc0dc8d7a2f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 24 Aug 2021 15:33:07 +0100 Subject: [PATCH] Fix issue when rendering fields without field names --- packages/standard-components/src/forms/Field.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/standard-components/src/forms/Field.svelte b/packages/standard-components/src/forms/Field.svelte index 9f08f204c2..e490b27dcf 100644 --- a/packages/standard-components/src/forms/Field.svelte +++ b/packages/standard-components/src/forms/Field.svelte @@ -32,12 +32,12 @@ ) // Update form properties in parent component on every store change - const unsubscribe = formField.subscribe(value => { + const unsubscribe = formField?.subscribe(value => { fieldState = value?.fieldState fieldApi = value?.fieldApi fieldSchema = value?.fieldSchema }) - onDestroy(unsubscribe) + onDestroy(() => unsubscribe && unsubscribe()) // Keep validation rules up to date $: updateValidation(validation)