From 8e0c3cb608041c8f3d28d1bcaf6f0d4e159e688f Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 17 May 2022 18:26:14 +0000 Subject: fix auctionitems returning an empty object sometimes --- src/database.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/database.ts') diff --git a/src/database.ts b/src/database.ts index a8dd1a4..2b73c77 100644 --- a/src/database.ts +++ b/src/database.ts @@ -1113,7 +1113,8 @@ export async function updateItemAuction(auction: ItemAuctionsSchema) { /** * Fetches the SkyBlock ids of all the items in the auctions database. This method is slow and should be cached! */ -export async function fetchItemsAuctionsIds(): Promise { +export async function fetchItemsAuctionsIds(): Promise { + if (!itemAuctionsCollection) return undefined const docs = await itemAuctionsCollection?.aggregate([ // this removes everything except the _id { $project: { _id: true } } -- cgit