diff options
author | mat <github@matdoes.dev> | 2022-07-01 19:32:12 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-07-01 19:32:12 -0500 |
commit | 1a1a1b7f65d13f9050adb9fd182409d9c8dad948 (patch) | |
tree | f9eccf14de362e0903739303f9369fd6c3e6ad91 | |
parent | db91084c3cf4e3d26f6925c61b882c068832ae56 (diff) | |
download | skyblock-api-1a1a1b7f65d13f9050adb9fd182409d9c8dad948.tar.gz skyblock-api-1a1a1b7f65d13f9050adb9fd182409d9c8dad948.tar.bz2 skyblock-api-1a1a1b7f65d13f9050adb9fd182409d9c8dad948.zip |
fix for when there's no bidders
-rw-r--r-- | src/cleaners/skyblock/auctions.ts | 2 |
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, |