Skip to content

Commit edea0e5

Browse files
committed
chore: be more precise in check to continue with errors in getProfile
1 parent 86786af commit edea0e5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/profile.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,11 @@ export async function getProfile(
196196

197197
const { value } = res;
198198
const { errors } = value;
199-
if (!value.data && errors != null && errors.length > 0) {
199+
if (
200+
(!value.data || !value.data.user || !value.data.user.result) &&
201+
errors != null &&
202+
errors.length > 0
203+
) {
200204
return {
201205
success: false,
202206
err: new Error(errors.map((e) => e.message).join('\n')),

0 commit comments

Comments
 (0)