Quellcode durchsuchen

[FrameworkBundle] fixes a regression

Johannes Schmitt vor 14 Jahren
Ursprung
Commit
5da7896191
1 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  1. 3 2
      src/Symfony/Bundle/FrameworkBundle/Profiler/ProfilerListener.php

+ 3 - 2
src/Symfony/Bundle/FrameworkBundle/Profiler/ProfilerListener.php

@@ -68,7 +68,7 @@ class ProfilerListener
      */
     public function onCoreException(GetResponseForExceptionEvent $event)
     {
-        if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
+        if ($this->onlyMasterRequests && HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
             return;
         }
 
@@ -90,6 +90,7 @@ class ProfilerListener
             return;
         }
 
+        $exception = $this->exception;
         $this->exception = null;
 
         if (null !== $this->matcher && !$this->matcher->matches($event->getRequest())) {
@@ -102,6 +103,6 @@ class ProfilerListener
             $profiler->setParent($parent['request']['profiler']->getToken());
         }
 
-        $profiler->collect($event->getRequest(), $event->getResponse(), $this->exception);
+        $profiler->collect($event->getRequest(), $event->getResponse(), $exception);
     }
 }