From 6cf91ad923a4744b94d37d83bce59a255c6c5104 Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 13 Nov 2023 12:01:48 +0000 Subject: [PATCH] Skip null production objects inside `handleRecipe()` --- project/src/controllers/HideoutController.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/project/src/controllers/HideoutController.ts b/project/src/controllers/HideoutController.ts index e14c37d7..7b188ef1 100644 --- a/project/src/controllers/HideoutController.ts +++ b/project/src/controllers/HideoutController.ts @@ -652,7 +652,7 @@ export class HideoutController let counterHoursCrafting = pmcData.BackendCounters[HideoutController.nameBackendCountersCrafting]; if (!counterHoursCrafting) { - pmcData.BackendCounters[HideoutController.nameBackendCountersCrafting] = { "id": HideoutController.nameBackendCountersCrafting, "value": 0 }; + pmcData.BackendCounters[HideoutController.nameBackendCountersCrafting] = { id: HideoutController.nameBackendCountersCrafting, value: 0 }; counterHoursCrafting = pmcData.BackendCounters[HideoutController.nameBackendCountersCrafting]; } let hoursCrafting = counterHoursCrafting.value; @@ -680,6 +680,12 @@ export class HideoutController let prodId: string; for (const x of entries) { + // Skip null production objects + if (!x[1]) + { + continue; + } + if (this.hideoutHelper.isProductionType(x[1])) // Production or ScavCase { if ((x[1] as Production).RecipeId === request.recipeId)