Skip to content

Commit

Permalink
Once settled, don't allow further rejection of additional promises
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Oct 16, 2024
1 parent 6ea8dd0 commit 2cfa4df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ function ($value, $idx) use (&$results): void {
$results[$idx] = $value;
},
function ($reason, $idx, Promise $aggregate): void {
$aggregate->reject($reason);
if (Is::pending($aggregate)) {
$aggregate->reject($reason);
}
}
)->then(function () use (&$results) {
ksort($results);
Expand Down

0 comments on commit 2cfa4df

Please sign in to comment.