Fixing more crashing bugs

This commit is contained in:
Michael Schmatz 2014-11-25 11:20:39 -05:00
parent 30e08e2c99
commit 2b8006ff83

View file

@ -14,7 +14,7 @@ class LevelSessionHandler extends Handler
formatEntity: (req, document) ->
documentObject = super(req, document)
if req.user.isAdmin() or req.user.id is document.creator or ('employer' in (req.user.get('permissions') ? []))
if req.user?.isAdmin() or req.user?.id is document.creator or ('employer' in (req.user?.get('permissions') ? []))
return documentObject
else
return _.omit documentObject, @privateProperties