Skip to content

Commit

Permalink
fix error shown even when it's empty/null
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Dec 14, 2023
1 parent e81ed8f commit ac6f8f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function hasPolicyMemberError(policyMembers: OnyxEntry<PolicyMembers>): boolean
* Check if the policy has any error fields.
*/
function hasPolicyErrorFields(policy: OnyxEntry<Policy>): 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);
}

/**
Expand Down

0 comments on commit ac6f8f3

Please sign in to comment.