mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-24 00:53:06 +00:00
Produce a null value, rather than crashing when the user info service returns 404.
This commit is contained in:
parent
775f5ebbe1
commit
522786d45e
1 changed files with 5 additions and 0 deletions
|
@ -13,6 +13,8 @@ module.exports = WebApiManager =
|
|||
}, (error, res, body)->
|
||||
if error?
|
||||
return callback(error)
|
||||
if res.statusCode == 404
|
||||
return callback null, null
|
||||
if res.statusCode >= 200 and res.statusCode < 300
|
||||
return callback null, body
|
||||
else
|
||||
|
@ -27,6 +29,9 @@ module.exports = WebApiManager =
|
|||
logger.error err: error, user_id: user_id, url: url, "error accessing web"
|
||||
return callback error
|
||||
|
||||
if body == null
|
||||
logger.error user_id: user_id, url: url, "no user found"
|
||||
return callback null, null
|
||||
try
|
||||
user = JSON.parse(body)
|
||||
catch error
|
||||
|
|
Loading…
Reference in a new issue