XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

chore: ignore invalid item ids in saveLoadout (#2320)

With the 'IsNew' flag + webui delete item, this is quite easy to trigger and shouldn't prevent the other changes from going through. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2320 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

31e24c27
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

1 个文件 +4 -2
Modified src/services/saveLoadoutService.ts +4 -2
@@ -149,7 +149,8 @@ export const handleInventoryItemConfigChange = async (
149 149 } else {
150 150 const inventoryItem = inventory.WeaponSkins.id(itemId);
151 151 if (!inventoryItem) {
152 throw new Error(`inventory item WeaponSkins not found with id ${itemId}`);
152 logger.warn(`inventory item WeaponSkins not found with id ${itemId}`);
153 continue;
153 154 }
154 155 if ("Favorite" in itemConfigEntries) {
155 156 inventoryItem.Favorite = itemConfigEntries.Favorite;
@@ -177,7 +178,8 @@ export const handleInventoryItemConfigChange = async (
177 178 const inventoryItem = inventory[equipmentName].id(itemId);
178 179
179 180 if (!inventoryItem) {
180 throw new Error(`inventory item ${equipmentName} not found with id ${itemId}`);
181 logger.warn(`inventory item ${equipmentName} not found with id ${itemId}`);
182 continue;
181 183 }
182 184
183 185 for (const [configId, config] of Object.entries(itemConfigEntries)) {