mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Add null checks for null folders
This commit is contained in:
parent
e4e14602f1
commit
dc9fff94f3
1 changed files with 2 additions and 2 deletions
|
@ -61,7 +61,7 @@ module.exports = DocManager =
|
|||
else
|
||||
callback null, null, null
|
||||
|
||||
_findDocInFolder: (folder, doc_id, currentPath) ->
|
||||
_findDocInFolder: (folder = {}, doc_id, currentPath) ->
|
||||
for doc, i in folder.docs or []
|
||||
if doc._id.toString() == doc_id.toString()
|
||||
return {
|
||||
|
@ -75,7 +75,7 @@ module.exports = DocManager =
|
|||
|
||||
return null
|
||||
|
||||
_findAllDocsInFolder: (folder) ->
|
||||
_findAllDocsInFolder: (folder = {}) ->
|
||||
docs = folder.docs or []
|
||||
for childFolder in folder.folders or []
|
||||
docs = docs.concat @_findAllDocsInFolder childFolder
|
||||
|
|
Loading…
Reference in a new issue