Safe access to potentially-null project
This commit is contained in:
@@ -23,7 +23,7 @@ module.exports = EditorHttpController =
|
||||
EditorHttpController._buildJoinProjectView req, project_id, user_id, (error, project, privilegeLevel) ->
|
||||
return next(error) if error?
|
||||
# Hide access tokens if this is not the project owner
|
||||
if privilegeLevel != 'owner' && project.tokens?
|
||||
if privilegeLevel != 'owner' && project?.tokens?
|
||||
project.tokens = {readOnly: '', readAndWrite: ''}
|
||||
res.json {
|
||||
project: project
|
||||
|
||||
Reference in New Issue
Block a user