mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-09 00:22:38 +00:00
handle a null in the file refs list
this seems to happen now and then when there is networking issues
This commit is contained in:
parent
4f590d7acb
commit
d428e7e5b4
2 changed files with 6 additions and 2 deletions
|
@ -1,3 +1,5 @@
|
|||
_ = require("underscore")
|
||||
|
||||
module.exports = ProjectEditorHandler =
|
||||
buildProjectModelView: (project, options) ->
|
||||
options ||= {}
|
||||
|
@ -55,10 +57,11 @@ module.exports = ProjectEditorHandler =
|
|||
signUpDate : user.signUpDate
|
||||
|
||||
buildFolderModelView: (folder) ->
|
||||
fileRefs = _.filter folder.fileRefs, (file)-> file?
|
||||
_id : folder._id
|
||||
name : folder.name
|
||||
folders : @buildFolderModelView childFolder for childFolder in folder.folders
|
||||
fileRefs : @buildFileModelView file for file in folder.fileRefs
|
||||
fileRefs : @buildFileModelView file for file in fileRefs
|
||||
docs : @buildDocModelView doc for doc in folder.docs
|
||||
|
||||
buildFileModelView: (file) ->
|
||||
|
|
|
@ -64,7 +64,8 @@ module.exports = ProjectEntityHandler =
|
|||
files = {}
|
||||
for folderPath, folder of folders
|
||||
for file in folder.fileRefs
|
||||
files[path.join(folderPath, file.name)] = file
|
||||
if file?
|
||||
files[path.join(folderPath, file.name)] = file
|
||||
callback null, files
|
||||
|
||||
flushProjectToThirdPartyDataStore: (project_id, callback) ->
|
||||
|
|
Loading…
Add table
Reference in a new issue