mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-25 02:31:19 +00:00
null check folder in findElement
https://sentry.io/sharelatex-1/sl-web-server-prod/issues/236000085/
This commit is contained in:
parent
31b1c53faa
commit
8ee2e5ba63
2 changed files with 3 additions and 1 deletions
|
@ -26,6 +26,8 @@ module.exports = ProjectLocator =
|
|||
element = _.find searchFolder[elementType], (el)-> el?._id+'' == element_id+'' #need to ToString both id's for robustness
|
||||
if !element? && searchFolder.folders? && searchFolder.folders.length != 0
|
||||
_.each searchFolder.folders, (folder, index)->
|
||||
if !folder?
|
||||
return
|
||||
newPath = {}
|
||||
newPath[key] = value for own key,value of path #make a value copy of the string
|
||||
newPath.fileSystem += "/#{folder.name}"
|
||||
|
|
|
@ -17,7 +17,7 @@ file1 = name:"file1", _id:"dsa9lkdsad"
|
|||
subSubFile = name:"subSubFile", _id:"d1d2dk"
|
||||
subSubDoc = name:"subdoc.txt", _id:"321dmdwi"
|
||||
secondSubFolder = name:"secondSubFolder", _id:"dsa3e23", docs:[subSubDoc], fileRefs:[subSubFile], folders:[]
|
||||
subFolder = name:"subFolder", _id:"dsadsa93", folders:[secondSubFolder], docs:[], fileRefs:[]
|
||||
subFolder = name:"subFolder", _id:"dsadsa93", folders:[secondSubFolder, null], docs:[], fileRefs:[]
|
||||
subFolder1 = name:"subFolder1", _id:"123asdjoij"
|
||||
|
||||
rootFolder =
|
||||
|
|
Loading…
Reference in a new issue