mirror of
https://github.com/overleaf/overleaf.git
synced 2024-09-16 02:52:31 -04: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) ->
|
EditorHttpController._buildJoinProjectView req, project_id, user_id, (error, project, privilegeLevel) ->
|
||||||
return next(error) if error?
|
return next(error) if error?
|
||||||
# Hide access tokens if this is not the project owner
|
# Hide access tokens if this is not the project owner
|
||||||
if privilegeLevel != 'owner' && project.tokens?
|
if privilegeLevel != 'owner' && project?.tokens?
|
||||||
project.tokens = {readOnly: '', readAndWrite: ''}
|
project.tokens = {readOnly: '', readAndWrite: ''}
|
||||||
res.json {
|
res.json {
|
||||||
project: project
|
project: project
|
||||||
|
|
Loading…
Reference in a new issue