mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-24 18:12:02 +00:00
Do a check for null docs
This commit is contained in:
parent
ccbe33a82e
commit
43ed71e82c
1 changed files with 5 additions and 1 deletions
|
@ -18,7 +18,11 @@ module.exports = HttpController =
|
|||
logger.log project_id: project_id, "getting all docs"
|
||||
DocManager.getAllDocs project_id, (error, docs = []) ->
|
||||
return next(error) if error?
|
||||
res.json docs.map(HttpController._buildDocView)
|
||||
docViews = []
|
||||
for doc in docs
|
||||
if doc? # There can end up being null docs for some reason :( (probably a race condition)
|
||||
docViews.push HttpController._buildDocView(doc)
|
||||
res.json docViews
|
||||
|
||||
updateDoc: (req, res, next = (error) ->) ->
|
||||
project_id = req.params.project_id
|
||||
|
|
Loading…
Reference in a new issue