mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
defend against undefined plan_code
This commit is contained in:
parent
81d0edf716
commit
fc068b62a2
1 changed files with 4 additions and 0 deletions
|
@ -170,6 +170,10 @@ module.exports = SubscriptionController =
|
||||||
AuthenticationController.getLoggedInUser req, (error, user) ->
|
AuthenticationController.getLoggedInUser req, (error, user) ->
|
||||||
return next(error) if error?
|
return next(error) if error?
|
||||||
planCode = req.body.plan_code
|
planCode = req.body.plan_code
|
||||||
|
if !planCode?
|
||||||
|
err = new Error('plan_code not defined')
|
||||||
|
logger.err {user_id: user._id, err}, "error updating subscription"
|
||||||
|
return next(err)
|
||||||
logger.log planCode: planCode, user_id:user._id, "updating subscription"
|
logger.log planCode: planCode, user_id:user._id, "updating subscription"
|
||||||
SubscriptionHandler.updateSubscription user, planCode, null, (err)->
|
SubscriptionHandler.updateSubscription user, planCode, null, (err)->
|
||||||
if err?
|
if err?
|
||||||
|
|
Loading…
Reference in a new issue