aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-06-03 15:05:28 -0500
committermat <github@matdoes.dev>2021-06-03 15:05:28 -0500
commitb69726c8a1d59a1f1bcb891fb943f7252b31044c (patch)
treebe6802b1f4f15d30806f2eb9b604beba0aa4e4c9 /src
parent2eb6d7658ac0afa45fd8258a68c7640e4c9e372e (diff)
downloadskyblock-api-b69726c8a1d59a1f1bcb891fb943f7252b31044c.tar.gz
skyblock-api-b69726c8a1d59a1f1bcb891fb943f7252b31044c.tar.bz2
skyblock-api-b69726c8a1d59a1f1bcb891fb943f7252b31044c.zip
return null if fetchMemberProfile user uuid is null
Diffstat (limited to 'src')
-rw-r--r--src/hypixel.ts3
-rw-r--r--src/mojang.ts5
2 files changed, 4 insertions, 4 deletions
diff --git a/src/hypixel.ts b/src/hypixel.ts
index f8041f5..bfb826e 100644
--- a/src/hypixel.ts
+++ b/src/hypixel.ts
@@ -147,8 +147,9 @@ export async function fetchMemberProfile(user: string, profile: string, customiz
const websiteAccountPromise = customization ? fetchAccount(playerUuid) : null
const profileUuid = await cached.fetchProfileUuid(user, profile)
- // if the profile doesn't have an id, just return
+ // if the profile or player doesn't have an id, just return
if (!profileUuid) return null
+ if (!playerUuid) return null
const player = await cached.fetchPlayer(playerUuid)
diff --git a/src/mojang.ts b/src/mojang.ts
index 055809a..4d07436 100644
--- a/src/mojang.ts
+++ b/src/mojang.ts
@@ -75,9 +75,8 @@ export async function profileFromUsername(username: string): Promise<MojangApiRe
if (!data?.id) {
- return { uuid: null, username: null }
- // console.log('mojang api failed, trying ashcon as backup')
- // return await profileFromUsernameAlternative(username)
+ // return { uuid: null, username: null }
+ return await profileFromUsernameAlternative(username)
}
return {
uuid: data.id,