fix: handle gql error correctly (#7507)

This commit is contained in:
DarkSky
2024-07-15 17:24:43 +08:00
committed by GitHub
parent b50c57a3fa
commit 1f50c1b890
3 changed files with 8 additions and 3 deletions

View File

@@ -26,7 +26,12 @@ export class UserFriendlyError implements UserFriendlyErrorResponse {
return new UserFriendlyError(response.extensions);
}
if (typeof response === 'object' && response.type && response.name) {
if (
response &&
typeof response === 'object' &&
response.type &&
response.name
) {
return new UserFriendlyError(response);
}