From 2cfa4dfe278ef77e0a5948b8a4dc2e0c2e278193 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Wed, 16 Oct 2024 17:34:56 +0100 Subject: [PATCH] Once settled, don't allow further rejection of additional promises --- src/Utils.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Utils.php b/src/Utils.php index 45b0893..3193d2a 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -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);