Pārlūkot izejas kodu

[FrameworkBundle] made some small tweaks

Fabien Potencier 14 gadi atpakaļ
vecāks
revīzija
5591f34c01

+ 6 - 5
src/Symfony/Bundle/FrameworkBundle/Profiler/ProfilerListener.php

@@ -85,14 +85,16 @@ class ProfilerListener
         $response = $event->getResponse();
 
         if ($this->onlyMasterRequests && HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
-            return $response;
+            return;
         }
 
-        if (null !== $this->matcher && !$this->matcher->matches($event->getRequest())) {
-            return $response;
+        if ($this->onlyException && null === $this->exception) {
+            return;
         }
 
-        if ($this->onlyException && null === $this->exception) {
+        $this->exception = null;
+
+        if (null !== $this->matcher && !$this->matcher->matches($event->getRequest())) {
             return;
         }
 
@@ -103,6 +105,5 @@ class ProfilerListener
         }
 
         $profiler->collect($event->getRequest(), $event->getResponse(), $this->exception);
-        $this->exception = null;
     }
 }