diff options
-rw-r--r-- | src/cleaners/player.ts | 2 | ||||
-rw-r--r-- | src/cleaners/skyblock/member.ts | 1 | ||||
-rw-r--r-- | src/cleaners/skyblock/profile.ts | 2 | ||||
-rw-r--r-- | src/cleaners/skyblock/stats.ts | 3 | ||||
-rw-r--r-- | src/hypixelCached.ts | 1 |
5 files changed, 7 insertions, 2 deletions
diff --git a/src/cleaners/player.ts b/src/cleaners/player.ts index d23fe29..fb8af78 100644 --- a/src/cleaners/player.ts +++ b/src/cleaners/player.ts @@ -19,6 +19,8 @@ export interface CleanPlayer extends CleanBasicPlayer { export async function cleanPlayerResponse(data: HypixelPlayer): Promise<CleanPlayer> { // Cleans up a 'player' api response + if (!data) + return // bruh return { uuid: undashUuid(data.uuid), username: data.displayname, diff --git a/src/cleaners/skyblock/member.ts b/src/cleaners/skyblock/member.ts index a4ca053..424bb9b 100644 --- a/src/cleaners/skyblock/member.ts +++ b/src/cleaners/skyblock/member.ts @@ -52,6 +52,7 @@ export async function cleanSkyBlockProfileMemberResponse(member, included: Inclu // profiles.members[] const inventoriesIncluded = included == null || included.includes('inventories') const player = await cached.fetchPlayer(member.uuid) + if (!player) return return { uuid: member.uuid, username: player.username, diff --git a/src/cleaners/skyblock/profile.ts b/src/cleaners/skyblock/profile.ts index 6e98f8f..086cd31 100644 --- a/src/cleaners/skyblock/profile.ts +++ b/src/cleaners/skyblock/profile.ts @@ -58,7 +58,7 @@ export async function cleanSkyblockProfileResponse(data: any, options?: ApiOptio )) } - const cleanedMembers: CleanMember[] = await Promise.all(promises) + const cleanedMembers: CleanMember[] = (await Promise.all(promises)).filter(m => m !== null && m !== undefined) const memberMinions: CleanMinion[][] = [] diff --git a/src/cleaners/skyblock/stats.ts b/src/cleaners/skyblock/stats.ts index db8f8c9..6c274bc 100644 --- a/src/cleaners/skyblock/stats.ts +++ b/src/cleaners/skyblock/stats.ts @@ -1,10 +1,11 @@ const statCategories: { [ key: string ]: string[] | null } = { // sorted in order of importance 'deaths': ['deaths_', 'deaths'], 'kills': ['kills_', 'kills'], - 'fishing': ['items_fished_', 'items_fished'], + 'fishing': ['items_fished_', 'items_fished', 'shredder_'], 'auctions': ['auctions_'], 'collection': ['collection_'], 'races': ['_best_time', '_best_time_2'], + 'mythos': ['mythos_burrows_', 'mythos_kills'], 'misc': null // everything else goes here } diff --git a/src/hypixelCached.ts b/src/hypixelCached.ts index 8e630df..4ddb07c 100644 --- a/src/hypixelCached.ts +++ b/src/hypixelCached.ts @@ -129,6 +129,7 @@ export async function fetchPlayer(user: string): Promise<CleanPlayer> { path: 'player', args: { uuid: playerUuid } }) + if (!cleanPlayer) return // clone in case it gets modified somehow later const cleanPlayerClone = Object.assign({}, cleanPlayer) |