check if crewmate slots exist before creating OID

This commit is contained in:
nrbdev 2025-01-11 06:08:56 -05:00
parent fb8e19403e
commit 3d6cd3c4aa

View File

@ -682,11 +682,11 @@ crewShipMembersSchema.set("toJSON", {
virtuals: true, virtuals: true,
transform(_doc, ret) { transform(_doc, ret) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
ret.SLOT_A = { ItemId: toOid(ret.SLOT_A) }; ret.SLOT_A ? { ItemId: toOid(ret.SLOT_A) } : null;
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
ret.SLOT_B = { ItemId: toOid(ret.SLOT_B) }; ret.SLOT_B ? { ItemId: toOid(ret.SLOT_B) } : null;
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
ret.SLOT_C = { ItemId: toOid(ret.SLOT_C) }; ret.SLOT_C ? { ItemId: toOid(ret.SLOT_C) } : null;
} }
}); });