chore: ignore invalid item ids in saveLoadout #2320
@ -149,7 +149,8 @@ export const handleInventoryItemConfigChange = async (
 | 
				
			|||||||
                    } else {
 | 
					                    } else {
 | 
				
			||||||
                        const inventoryItem = inventory.WeaponSkins.id(itemId);
 | 
					                        const inventoryItem = inventory.WeaponSkins.id(itemId);
 | 
				
			||||||
                        if (!inventoryItem) {
 | 
					                        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) {
 | 
					                        if ("Favorite" in itemConfigEntries) {
 | 
				
			||||||
                            inventoryItem.Favorite = itemConfigEntries.Favorite;
 | 
					                            inventoryItem.Favorite = itemConfigEntries.Favorite;
 | 
				
			||||||
@ -177,7 +178,8 @@ export const handleInventoryItemConfigChange = async (
 | 
				
			|||||||
                        const inventoryItem = inventory[equipmentName].id(itemId);
 | 
					                        const inventoryItem = inventory[equipmentName].id(itemId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        if (!inventoryItem) {
 | 
					                        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)) {
 | 
					                        for (const [configId, config] of Object.entries(itemConfigEntries)) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user