From ac6f8f3bc5ad063a8bc058da2487b16fbe4a1090 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 14 Dec 2023 12:19:36 +0800 Subject: [PATCH] fix error shown even when it's empty/null --- src/libs/PolicyUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } /**