Null pointer fix
This commit is contained in:
parent
035a7ee625
commit
c2fc1598fa
|
@ -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…
Reference in New Issue