mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01: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:
@@ -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) ->
|
||||
|
||||
Reference in New Issue
Block a user