Fixed bug with credit fields

This commit is contained in:
DrMint 2024-04-10 19:04:41 +02:00
parent 8832434010
commit 23b1c16bf7
1 changed files with 1 additions and 1 deletions

View File

@ -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)) {