null check user_id

This commit is contained in:
Henry Oswald 2016-09-26 17:25:11 +01:00 committed by GitHub
parent 8558ce1f75
commit 6141eb4a44

View file

@ -38,7 +38,7 @@ module.exports = UniversityController =
getIndexPage: (req, res)-> getIndexPage: (req, res)->
user_id = AuthenticationController.getLoggedInUserId(req) user_id = AuthenticationController.getLoggedInUserId(req)
client = sixpack.client(user_id.toString() || req.ip) client = sixpack.client(user_id?.toString() || req.ip)
client.participate 'instapage-pages', ['default', 'instapage'], (err, response)-> client.participate 'instapage-pages', ['default', 'instapage'], (err, response)->
if response?.alternative?.name == "instapage" if response?.alternative?.name == "instapage"
return res.redirect("/i/university") return res.redirect("/i/university")