diff --git a/src/libs/PolicyUtils.ts b/src/libs/PolicyUtils.ts index 347e5b68e960..220f58fe671e 100644 --- a/src/libs/PolicyUtils.ts +++ b/src/libs/PolicyUtils.ts @@ -31,7 +31,7 @@ function hasPolicyMemberError(policyMembers: OnyxEntry): boolean * Check if the policy has any error fields. */ function hasPolicyErrorFields(policy: OnyxEntry): boolean { - return Object.keys(policy?.errorFields ?? {}).some((fieldErrors) => Object.keys(fieldErrors ?? {}).length > 0); + return Object.values(policy?.errorFields ?? {}).some((fieldErrors) => Object.keys(fieldErrors ?? {}).length > 0); } /**