mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-30 19:40:55 +00:00
Safe access to potentially-null project
This commit is contained in:
parent
b8d90a1a99
commit
bb0dad3353
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue