From 6c1935f93f3a85373e7c443c4a9a1bd8655ab668 Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 12 Jun 2024 23:07:38 +0100 Subject: [PATCH] Added nullguard when purchasing trader assort with 0 items --- project/src/helpers/TradeHelper.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/project/src/helpers/TradeHelper.ts b/project/src/helpers/TradeHelper.ts index 7bafca09..2e577bc0 100644 --- a/project/src/helpers/TradeHelper.ts +++ b/project/src/helpers/TradeHelper.ts @@ -186,6 +186,10 @@ export class TradeHelper // Get item + children for purchase const relevantItems = this.itemHelper.findAndReturnChildrenAsItems(traderItems, buyRequestData.item_id); + if (relevantItems.length === 0) + { + this.logger.error(`Purchased trader: ${buyRequestData.tid} offer: ${buyRequestData.item_id} has no items`); + } offerItems.push(...relevantItems); }