check if crewmate slots exist before creating OID
This commit is contained in:
parent
fb8e19403e
commit
3d6cd3c4aa
@ -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;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user