aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-07-01 19:32:12 -0500
committermat <github@matdoes.dev>2022-07-01 19:32:12 -0500
commit1a1a1b7f65d13f9050adb9fd182409d9c8dad948 (patch)
treef9eccf14de362e0903739303f9369fd6c3e6ad91 /src/cleaners
parentdb91084c3cf4e3d26f6925c61b882c068832ae56 (diff)
downloadskyblock-api-1a1a1b7f65d13f9050adb9fd182409d9c8dad948.tar.gz
skyblock-api-1a1a1b7f65d13f9050adb9fd182409d9c8dad948.tar.bz2
skyblock-api-1a1a1b7f65d13f9050adb9fd182409d9c8dad948.zip
fix for when there's no bidders
Diffstat (limited to 'src/cleaners')
-rw-r--r--src/cleaners/skyblock/auctions.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cleaners/skyblock/auctions.ts b/src/cleaners/skyblock/auctions.ts
index a43001b..d47e5f2 100644
--- a/src/cleaners/skyblock/auctions.ts
+++ b/src/cleaners/skyblock/auctions.ts
@@ -43,7 +43,7 @@ export async function cleanAuctions(data: typedHypixelApi.SkyBlockRequestAuction
}
async function cleanAuction(auction: typedHypixelApi.SkyBlockRequestAuctionResponse['auctions'][number]): Promise<Auction> {
- const buyerUuid = auction.end ? auction.bids[auction.bids.length - 1].bidder : null
+ const buyerUuid = auction.end ? (auction.bids[auction.bids.length - 1]?.bidder ?? null) : null
const buyer = buyerUuid ? await cached.fetchPlayer(buyerUuid, false) : null
return {
id: auction.uuid,