check user isn't null in project controller

This commit is contained in:
Henry Oswald 2014-03-31 10:54:49 +01:00
parent 6318d9ace1
commit cd683cc719

View file

@ -123,7 +123,7 @@ module.exports = class ProjectController
trackChanges: false
else
anonymous = false
SubscriptionLocator.getUsersSubscription user._id, (err, subscription)->
SubscriptionLocator.getUsersSubscription user?._id, (err, subscription)->
SecurityManager.userCanAccessProject user, project, (canAccess, privlageLevel)->
allowedFreeTrial = true
if subscription? and subscription.freeTrial? and subscription.freeTrial.expiresAt?