From f9119a59f56546f01ffd40f3efe9f7ec79fd9fbb Mon Sep 17 00:00:00 2001 From: "Gudmundur D. Haraldsson" Date: Tue, 17 Dec 2024 13:30:27 +0000 Subject: [PATCH] Update src/lib/utils.ts Co-authored-by: Roberson Gomes --- src/lib/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 9e77fc845..d2f7a32ee 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -92,8 +92,8 @@ export function parseApiError( err: { return err?.networkError?.message; } - if ( err?.graphQLErrors && err?.graphQLErrors?.length > 0 && err?.graphQLErrors[ 0 ]?.message ) { - return err?.graphQLErrors[ 0 ]?.message; + if ( err?.graphQLErrors?.[ 0 ]?.message ) { + return err.graphQLErrors[ 0 ].message; } if ( err?.message ) {