Merge pull request #12848 from overleaf/bg-fix-path-exception

add exception handling for  path.join in ProjectEntityHandler

GitOrigin-RevId: dad305057fd6b2821525ca5b6d1933824989e241
This commit is contained in:
Brian Gough
2023-05-02 09:18:57 +01:00
committed by Copybot
parent 6ef9be0d0c
commit 1da76f0a8d
7 changed files with 291 additions and 27 deletions

View File

@@ -1396,8 +1396,13 @@ const ProjectEntityUpdateHandler = {
return callback(error)
}
let { docs, files, folders } =
ProjectEntityHandler.getAllEntitiesFromProject(project)
let docs, files, folders
try {
;({ docs, files, folders } =
ProjectEntityHandler.getAllEntitiesFromProject(project))
} catch (error) {
return callback(error)
}
// _checkFileTree() must be passed the folders before docs and
// files
ProjectEntityUpdateHandler._checkFiletree(
@@ -1489,7 +1494,11 @@ const ProjectEntityUpdateHandler = {
// the case only because getAllEntitiesFromProject() returns folders
// in that order and resyncProjectHistory() calls us with the folders
// first.
adjustPathsAfterFolderRename(entity.path, newPath)
try {
adjustPathsAfterFolderRename(entity.path, newPath)
} catch (error) {
return callback(error)
}
}
}