From 84778bb94747390fbcc83a3d6a5bd69286208f61 Mon Sep 17 00:00:00 2001 From: mat-1 Date: Mon, 15 Feb 2021 01:35:32 +0000 Subject: Compiled TS into JS --- build/hypixel.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'build/hypixel.js') diff --git a/build/hypixel.js b/build/hypixel.js index 5c6ce4c..91ec025 100644 --- a/build/hypixel.js +++ b/build/hypixel.js @@ -107,6 +107,9 @@ exports.fetchUser = fetchUser; async function fetchMemberProfile(user, profile) { const playerUuid = await cached.uuidFromUser(user); const profileUuid = await cached.fetchProfileUuid(user, profile); + // if the profile doesn't have an id, just return + if (!profileUuid) + return null; const player = await cached.fetchPlayer(playerUuid); const cleanProfile = await cached.fetchProfile(playerUuid, profileUuid); const member = cleanProfile.members.find(m => m.uuid === playerUuid); @@ -117,6 +120,7 @@ async function fetchMemberProfile(user, profile) { username: m.username, first_join: m.first_join, last_save: m.last_save, + rank: m.rank }; }); cleanProfile.members = simpleMembers; -- cgit