Handle errors when projects are deleted while git-bridge requests are ongoing GitOrigin-RevId: 488c3d480f2bb58aebaac5bdcbb412009c14322a
@@ -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)
})
},
@@ -280,9 +280,7 @@ module.exports = ProjectLocator = {
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')