forked from OpenWF/SpaceNinjaServer
fix: handle client providing an invalid loadout id at EOM upload (#1486)
Reviewed-on: OpenWF/SpaceNinjaServer#1486 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
parent
ea6facf3fc
commit
f906cdb5e8
@ -441,7 +441,12 @@ export const addMissionInventoryUpdates = async (
|
|||||||
_id: new Types.ObjectId(ItemId.$oid),
|
_id: new Types.ObjectId(ItemId.$oid),
|
||||||
...loadoutConfigItemIdRemoved
|
...loadoutConfigItemIdRemoved
|
||||||
};
|
};
|
||||||
loadout.NORMAL.id(loadoutId)!.overwrite(loadoutConfigDatabase);
|
const dbConfig = loadout.NORMAL.id(loadoutId);
|
||||||
|
if (dbConfig) {
|
||||||
|
dbConfig.overwrite(loadoutConfigDatabase);
|
||||||
|
} else {
|
||||||
|
logger.warn(`couldn't update loadout because there's no config with id ${loadoutId}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await loadout.save();
|
await loadout.save();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user