fix null in inventory response
All checks were successful
Build / build (push) Successful in 47s
Build / build (pull_request) Successful in 1m7s

This commit is contained in:
Sainan 2025-06-17 00:03:57 +02:00
parent a1e56df519
commit cfa7def9d1

View File

@ -1073,6 +1073,11 @@ EquipmentSchema.set("toJSON", {
if (db.UmbraDate) { if (db.UmbraDate) {
client.UmbraDate = toMongoDate(db.UmbraDate); client.UmbraDate = toMongoDate(db.UmbraDate);
} }
if (client.ArchonCrystalUpgrades) {
// For some reason, mongoose turns empty objects here into nulls, so we have to fix it.
client.ArchonCrystalUpgrades = client.ArchonCrystalUpgrades.map(x => (x as unknown) ?? {});
}
} }
}); });