mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 04:41:32 +02:00
Add in extra null check
This commit is contained in:
@@ -63,7 +63,7 @@ module.exports = DocManager =
|
||||
|
||||
_findDocInFolder: (folder = {}, doc_id, currentPath) ->
|
||||
for doc, i in folder.docs or []
|
||||
if doc._id? and doc._id.toString() == doc_id.toString()
|
||||
if doc?._id? and doc._id.toString() == doc_id.toString()
|
||||
return {
|
||||
doc: doc
|
||||
mongoPath: "#{currentPath}.docs.#{i}"
|
||||
|
||||
Reference in New Issue
Block a user