Added nullguard when purchasing trader assort with 0 items

This commit is contained in:
Dev 2024-06-12 23:07:38 +01:00
parent da46a9cc93
commit 6c1935f93f

View File

@ -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);
}