mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-10 11:42:03 +00: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) {
|
if (!docs) {
|
||||||
throw new Errors.NotFoundError(`No docs for project ${projectId}`)
|
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) =>
|
await AsyncPool(PARALLEL_JOBS, docs, (doc) =>
|
||||||
unarchiveDoc(projectId, doc._id)
|
unarchiveDoc(projectId, doc._id)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue