From ea38e50cca1b7778dd436de2f48bc2ba37b4ed69 Mon Sep 17 00:00:00 2001 From: DrakiaXYZ Date: Thu, 25 Apr 2024 17:46:27 +0000 Subject: [PATCH] If the trader updateTime is missing min/max use defaults (!307) This is just another catch for people trying to run outdated trader mods, will use default refresh time instead of returning null for the trader update seconds. Lets users know in the console right off the bat that there's a problem with the trader Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com> Co-authored-by: Refringe Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/307 Co-authored-by: DrakiaXYZ Co-committed-by: DrakiaXYZ --- project/src/helpers/TraderHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/src/helpers/TraderHelper.ts b/project/src/helpers/TraderHelper.ts index 075e57fc..64d2f17d 100644 --- a/project/src/helpers/TraderHelper.ts +++ b/project/src/helpers/TraderHelper.ts @@ -272,7 +272,7 @@ export class TraderHelper public getTraderUpdateSeconds(traderId: string): number { const traderDetails = this.traderConfig.updateTime.find((x) => x.traderId === traderId); - if (!traderDetails) + if (!traderDetails || traderDetails.seconds.min === undefined || traderDetails.seconds.max === undefined) { this.logger.warning( this.localisationService.getText("trader-missing_trader_details_using_default_refresh_time", {