mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
try catch converting id to object id
This commit is contained in:
parent
6d10e45135
commit
e9232eb197
1 changed files with 4 additions and 1 deletions
|
@ -8,7 +8,10 @@ module.exports = UserGetter =
|
||||||
callback = projection
|
callback = projection
|
||||||
projection = {}
|
projection = {}
|
||||||
if typeof query == "string"
|
if typeof query == "string"
|
||||||
query = _id: ObjectId(query)
|
try
|
||||||
|
query = _id: ObjectId(query)
|
||||||
|
catch e
|
||||||
|
return callback(null, null)
|
||||||
else if query instanceof ObjectId
|
else if query instanceof ObjectId
|
||||||
query = _id: query
|
query = _id: query
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue