mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-28 11:31:55 +02:00
try catch converting id to object id
This commit is contained in:
@@ -8,7 +8,10 @@ module.exports = UserGetter =
|
||||
callback = projection
|
||||
projection = {}
|
||||
if typeof query == "string"
|
||||
query = _id: ObjectId(query)
|
||||
try
|
||||
query = _id: ObjectId(query)
|
||||
catch e
|
||||
return callback(null, null)
|
||||
else if query instanceof ObjectId
|
||||
query = _id: query
|
||||
|
||||
|
||||
Reference in New Issue
Block a user