chore: ignore invalid item ids in saveLoadout
All checks were successful
Build / build (pull_request) Successful in 55s

With the 'IsNew' flag + webui delete item, this is quite easy to trigger and shouldn't prevent the other changes from going through.
This commit is contained in:
Sainan 2025-06-27 01:12:36 +02:00
parent 4f1f9592b0
commit 69ec2fdce9

View File

@ -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)) {