Skip to content

Commit 60623b6

Browse files
committed
bug #61031 [HttpClient] return early if handle has been cleaned up before (xabbuh)
This PR was merged into the 7.2 branch. Discussion ---------- [HttpClient] return early if handle has been cleaned up before | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT When a request has been cleaned up by the PHP process there still can be an event that will later on try to generate the response. Previously this lead to a warning like `Undefined array key "bg"`. spotted in #58370 where this makes the test fail with PHPUnit 11.5: https://github.com/symfony/symfony/actions/runs/16051022174/job/45293445147#step:9:3827 Commits ------- fb4711b return early if handle has been cleaned up before
2 parents 0fdec91 + fb4711b commit 60623b6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/HttpClient/Response/AmpResponseV5.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ private static function generateResponse(Request $request, AmpClientStateV5 $mul
240240
$body = $response->getBody();
241241

242242
while (true) {
243+
if (!isset($multi->openHandles[$id])) {
244+
return;
245+
}
246+
243247
$multi->openHandles[$id]->complete();
244248
$multi->openHandles[$id] = new DeferredFuture();
245249

0 commit comments

Comments
 (0)