mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
added err check to project list page
This commit is contained in:
parent
811859a4a1
commit
5ac1b59a78
1 changed files with 5 additions and 2 deletions
|
@ -69,8 +69,11 @@ module.exports =
|
||||||
projects: (cb)->
|
projects: (cb)->
|
||||||
Project.findAllUsersProjects user_id, 'name lastUpdated publicAccesLevel', cb
|
Project.findAllUsersProjects user_id, 'name lastUpdated publicAccesLevel', cb
|
||||||
}, (err, results)->
|
}, (err, results)->
|
||||||
|
if err?
|
||||||
|
logger.err err:err, "error getting data for project list page"
|
||||||
|
return res.send 500
|
||||||
logger.log results:results, user_id:user_id, "rendering project list"
|
logger.log results:results, user_id:user_id, "rendering project list"
|
||||||
viewModel = _buildListViewModel results.projects[0], results.projects[1], results.projects[2], results.tags[0], results.tags[1], results.subscription[0]
|
viewModel = _buildListViewModel results.projects[0], results.projects[1], results.projects[2], results.tags[0], results.tags[1], results.subscription?[0]
|
||||||
res.render 'project/list', viewModel
|
res.render 'project/list', viewModel
|
||||||
timer.done()
|
timer.done()
|
||||||
|
|
||||||
|
@ -96,7 +99,7 @@ module.exports =
|
||||||
project = results.project
|
project = results.project
|
||||||
user = results.user
|
user = results.user
|
||||||
subscription = results.subscription
|
subscription = results.subscription
|
||||||
|
|
||||||
if user_id == 'openUser'
|
if user_id == 'openUser'
|
||||||
anonymous = true
|
anonymous = true
|
||||||
user = defaultSettingsForAnonymousUser(user_id)
|
user = defaultSettingsForAnonymousUser(user_id)
|
||||||
|
|
Loading…
Reference in a new issue