Skip to content

Commit c9ed762

Browse files
committed
bug #60019 [HttpKernel] Fix TraceableEventDispatcher when the Stopwatch service has been reset (lyrixx)
This PR was merged into the 6.4 branch. Discussion ---------- [HttpKernel] Fix `TraceableEventDispatcher` when the `Stopwatch` service has been reset | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT Commits ------- fb10db1 [HttpKernel] Fix TraceableEventDispatcher when the StopWatch service has been reset
2 parents 627f373 + fb10db1 commit c9ed762

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ protected function afterDispatch(string $eventName, object $event): void
6666
if (null === $sectionId) {
6767
break;
6868
}
69-
$this->stopwatch->stopSection($sectionId);
69+
try {
70+
$this->stopwatch->stopSection($sectionId);
71+
} catch (\LogicException) {
72+
// The stop watch service might have been reset in the meantime
73+
}
7074
break;
7175
case KernelEvents::TERMINATE:
7276
// In the special case described in the `preDispatch` method above, the `$token` section

0 commit comments

Comments
 (0)