mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Don't call AsyncPool with an empty array
This commit is contained in:
parent
fdefb311ab
commit
268f436461
1 changed files with 4 additions and 0 deletions
|
@ -84,6 +84,10 @@ async function unArchiveAllDocs(projectId) {
|
|||
if (!docs) {
|
||||
throw new Errors.NotFoundError(`No docs for project ${projectId}`)
|
||||
}
|
||||
if (!docs.length) {
|
||||
// AsyncPool will throw an error with an empty array
|
||||
return
|
||||
}
|
||||
await AsyncPool(PARALLEL_JOBS, docs, (doc) =>
|
||||
unarchiveDoc(projectId, doc._id)
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue