Merge pull request #2144 from overleaf/spd-unhandled-missing-project

Handle errors when projects are deleted while git-bridge requests are ongoing

GitOrigin-RevId: 488c3d480f2bb58aebaac5bdcbb412009c14322a
This commit is contained in:
Simon Detheridge 2019-09-11 12:05:30 +01:00 committed by sharelatex
parent 561d14bbb6
commit adbe19fa12
2 changed files with 5 additions and 3 deletions

View file

@ -110,6 +110,10 @@ const ProjectEntityHandler = {
if (err != null) {
return callback(err)
}
if (project == null) {
return callback(new Errors.NotFoundError('project not found'))
}
return ProjectEntityHandler.getAllEntitiesFromProject(project, callback)
})
},

View file

@ -280,9 +280,7 @@ module.exports = ProjectLocator = {
return callback(err)
}
if (project == null) {
return callback(
`project could not be found for finding a element ${project._id}`
)
return callback('Tried to find an element for a null project')
}
if (needlePath === '' || needlePath === '/') {
return callback(null, project.rootFolder[0], 'folder')