From 91abd419f7b32595f422210c08f9e6c9c4a30bc2 Mon Sep 17 00:00:00 2001 From: Sainan Date: Mon, 6 May 2024 15:07:36 +0200 Subject: [PATCH] fix: error when using consumable item in mission (#165) --- src/services/inventoryService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index 8dd086fa..fc4fbe41 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -319,7 +319,9 @@ export const missionInventoryUpdate = async (data: IMissionInventoryUpdateReques addConsumables(inventory, Consumables); addRecipes(inventory, Recipes); addChallenges(inventory, ChallengeProgress); - addMissionComplete(inventory, Missions!); + if (Missions) { + addMissionComplete(inventory, Missions); + } const changedInventory = await inventory.save(); return changedInventory.toJSON();