From 23b1c16bf74855f508c1669f42c941cdc90e59e8 Mon Sep 17 00:00:00 2001 From: DrMint <29893320+DrMint@users.noreply.github.com> Date: Wed, 10 Apr 2024 19:04:41 +0200 Subject: [PATCH] Fixed bug with credit fields --- src/fields/creditsField/creditsField.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fields/creditsField/creditsField.ts b/src/fields/creditsField/creditsField.ts index 3106d41..8dfb9dc 100644 --- a/src/fields/creditsField/creditsField.ts +++ b/src/fields/creditsField/creditsField.ts @@ -21,7 +21,7 @@ export const creditsField = ({ validate, admin, ...props }: Props): ArrayField = } const data = options.data[props.name] as Credits | undefined | null; - if (isUndefined(data)) return true; + if (isUndefined(data) || typeof data !== "object") return true; const roles = data.map((row) => (isPayloadType(row.role) ? row.role.id : row.role)); if (hasDuplicates(roles)) {