From d2f4327871c9c7e411477f0b8f35f1225161871b Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 10 Nov 2023 19:18:58 +0000 Subject: [PATCH] Update `updateProductionTimers()` to handle `Progress` value being undefined --- project/src/helpers/HideoutHelper.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/project/src/helpers/HideoutHelper.ts b/project/src/helpers/HideoutHelper.ts index 3ceef96c..29d81a1f 100644 --- a/project/src/helpers/HideoutHelper.ts +++ b/project/src/helpers/HideoutHelper.ts @@ -233,6 +233,12 @@ export class HideoutHelper delete pmcData.Hideout.Production[prodId]; } + if (craft.Progress === undefined) + { + this.logger.warning(`Craft ${prodId} has an undefined progress value, defaulting to 0`); + craft.Progress = 0; + } + // Craft complete, skip processing (Don't skip continious crafts like bitcoin farm) if (craft.Progress >= craft.ProductionTime && prodId !== HideoutHelper.bitcoinFarm) {