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

SpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/SpaceNinjaServer

fix: handle client providing an invalid loadout id at EOM upload (#1486)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1486 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

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

代码差异

1 个文件 +6 -1
Modified src/services/missionInventoryUpdateService.ts +6 -1
@@ -441,7 +441,12 @@ export const addMissionInventoryUpdates = async (
441 441 _id: new Types.ObjectId(ItemId.$oid),
442 442 ...loadoutConfigItemIdRemoved
443 443 };
444 loadout.NORMAL.id(loadoutId)!.overwrite(loadoutConfigDatabase);
444 const dbConfig = loadout.NORMAL.id(loadoutId);
445 if (dbConfig) {
446 dbConfig.overwrite(loadoutConfigDatabase);
447 } else {
448 logger.warn(`couldn't update loadout because there's no config with id ${loadoutId}`);
449 }
445 450 }
446 451 await loadout.save();
447 452 }