Browse Source

Null pointer fix

pull/5877/head
Mel O'Hagan 4 years ago
committed by mike12345567
parent
commit
a58f35a6cd
  1. 4
      packages/server/src/integrations/mongodb.ts

4
packages/server/src/integrations/mongodb.ts

@ -91,7 +91,9 @@ module MongoDBModule {
json[field] = self.createObjectIds(json[field]) json[field] = self.createObjectIds(json[field])
} }
if (field === "_id") { if (field === "_id") {
const id = json["_id"].match(/(?<=objectid\(['"]).*(?=['"]\))/gi)[0] const id = json["_id"].match(
/(?<=objectid\(['"]).*(?=['"]\))/gi
)?.[0]
if (id) { if (id) {
json["_id"] = new ObjectID.createFromHexString(id) json["_id"] = new ObjectID.createFromHexString(id)
} }

Loading…
Cancel
Save