diff options
author | mat <27899617+mat-1@users.noreply.github.com> | 2021-02-14 19:01:27 -0600 |
---|---|---|
committer | mat <27899617+mat-1@users.noreply.github.com> | 2021-02-14 19:01:27 -0600 |
commit | fd2348bf16c55422ec664e6677b636998eccc71c (patch) | |
tree | b729aeba3e4f6c332244d5ae263347a9a186a401 /src/hypixelCached.ts | |
parent | 8a21158dfaa6392ca6f8d7d8c218c69689236765 (diff) | |
download | skyblock-api-fd2348bf16c55422ec664e6677b636998eccc71c.tar.gz skyblock-api-fd2348bf16c55422ec664e6677b636998eccc71c.tar.bz2 skyblock-api-fd2348bf16c55422ec664e6677b636998eccc71c.zip |
fix special cases
some users dont have a rank, and some users dont have skyblock profiles
Diffstat (limited to 'src/hypixelCached.ts')
-rw-r--r-- | src/hypixelCached.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/hypixelCached.ts b/src/hypixelCached.ts index f98f6d6..35f1cbb 100644 --- a/src/hypixelCached.ts +++ b/src/hypixelCached.ts @@ -8,7 +8,6 @@ import * as hypixel from './hypixel' import { CleanPlayer } from './cleaners/player' import { undashUuid } from './util' import { CleanProfile, CleanFullProfile, CleanBasicProfile } from './cleaners/skyblock/profile' -import { cleanProfileStats } from './cleaners/skyblock/stats' // cache usernames for 4 hours @@ -177,6 +176,9 @@ async function fetchBasicProfiles(user: string): Promise<CleanBasicProfile[]> { * @param profile A profile name or profile uuid */ export async function fetchProfileUuid(user: string, profile: string) { + // if a profile wasn't provided, return + if (!profile) return null + const profiles = await fetchBasicProfiles(user) const profileUuid = undashUuid(profile) |