Skip to content

Commit 5a602cb

Browse files
authored
Merge pull request #128 from csgofloat/fix/loop-while-mutating
Fixes `setResponseRemaining` to Always Set All Responses
2 parents 6c49b27 + 3772617 commit 5a602cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/job.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class Job {
3838
}
3939

4040
setResponseRemaining(response) {
41-
for (const link of this.remainingLinks) {
41+
// Prevent operating on mutating list size
42+
for (const link of [...this.remainingLinks]) {
4243
this.setResponse(link.link.getParams().a, response);
4344
}
4445
}

0 commit comments

Comments
 (0)