From 1a1a1b7f65d13f9050adb9fd182409d9c8dad948 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 1 Jul 2022 19:32:12 -0500 Subject: fix for when there's no bidders --- src/cleaners/skyblock/auctions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cleaners/skyblock/auctions.ts') 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 { - 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, -- cgit