aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners
diff options
context:
space:
mode:
Diffstat (limited to 'src/cleaners')
-rw-r--r--src/cleaners/achievements.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cleaners/achievements.ts b/src/cleaners/achievements.ts
index beedaf9..edb4d07 100644
--- a/src/cleaners/achievements.ts
+++ b/src/cleaners/achievements.ts
@@ -27,6 +27,10 @@ export interface Achievements {
}
export async function cleanPlayerAchievements(data: typedHypixelApi.PlayerDataResponse['player']): Promise<Achievements> {
+ if (!data.achievements) {
+ return { tiered: [], challenge: [] }
+ }
+
const gameAchievements: typedHypixelApi.AchievementsResponse['achievements'] = await fetchAchievements()
for (const [gameId, achievementsData] of Object.entries(gameAchievements)) {