diff options
-rw-r--r-- | build/hypixel.js | 4 | ||||
-rw-r--r-- | build/mojang.js | 5 | ||||
-rw-r--r-- | src/hypixel.ts | 3 | ||||
-rw-r--r-- | src/mojang.ts | 5 |
4 files changed, 9 insertions, 8 deletions
diff --git a/build/hypixel.js b/build/hypixel.js index b00774d..4e9a2a2 100644 --- a/build/hypixel.js +++ b/build/hypixel.js @@ -125,9 +125,11 @@ async function fetchMemberProfile(user, profile, customization) { // we don't await the promise immediately so it can load while we do other stuff const websiteAccountPromise = customization ? database_1.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); const cleanProfile = await cached.fetchProfile(playerUuid, profileUuid); const member = cleanProfile.members.find(m => m.uuid === playerUuid); diff --git a/build/mojang.js b/build/mojang.js index 3ad8d5e..1c301da 100644 --- a/build/mojang.js +++ b/build/mojang.js @@ -61,9 +61,8 @@ async function profileFromUsername(username) { } catch { } if (!(data === null || data === void 0 ? void 0 : 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, 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, |