From 61d46062b77f52c35dd1129c80d7c9da14f0f2d5 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Fri, 5 Aug 2022 14:53:41 +0100 Subject: [PATCH] Handle non-array values --- .../client/src/components/app/forms/RelationshipField.svelte | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/client/src/components/app/forms/RelationshipField.svelte b/packages/client/src/components/app/forms/RelationshipField.svelte index 2c1136bea3..ce2f194786 100644 --- a/packages/client/src/components/app/forms/RelationshipField.svelte +++ b/packages/client/src/components/app/forms/RelationshipField.svelte @@ -55,6 +55,9 @@ if (!values) { return [] } + if (!Array.isArray(values)) { + values = [values] + } return values.map(value => (typeof value === "object" ? value._id : value)) }