From 69ec2fdce9e063dfb42a099bc865ae1fe8926174 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Fri, 27 Jun 2025 01:12:36 +0200 Subject: [PATCH] chore: ignore invalid item ids in saveLoadout With the 'IsNew' flag + webui delete item, this is quite easy to trigger and shouldn't prevent the other changes from going through. --- src/services/saveLoadoutService.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/services/saveLoadoutService.ts b/src/services/saveLoadoutService.ts index 0676d113..ff42ad82 100644 --- a/src/services/saveLoadoutService.ts +++ b/src/services/saveLoadoutService.ts @@ -149,7 +149,8 @@ export const handleInventoryItemConfigChange = async ( } else { const inventoryItem = inventory.WeaponSkins.id(itemId); if (!inventoryItem) { - throw new Error(`inventory item WeaponSkins not found with id ${itemId}`); + logger.warn(`inventory item WeaponSkins not found with id ${itemId}`); + continue; } if ("Favorite" in itemConfigEntries) { inventoryItem.Favorite = itemConfigEntries.Favorite; @@ -177,7 +178,8 @@ export const handleInventoryItemConfigChange = async ( const inventoryItem = inventory[equipmentName].id(itemId); if (!inventoryItem) { - throw new Error(`inventory item ${equipmentName} not found with id ${itemId}`); + logger.warn(`inventory item ${equipmentName} not found with id ${itemId}`); + continue; } for (const [configId, config] of Object.entries(itemConfigEntries)) { -- 2.47.2