Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / debug / ErrorHandler.php
index 07e0861122a5df9eb4ce6d45eba1389bbe28c120..9f886a6d5d322026de43a15f745bcdab4b0ad93a 100644 (file)
@@ -579,15 +579,16 @@ class ErrorHandler
                 }
             }
         }
+        $exceptionHandler = $this->exceptionHandler;
+        $this->exceptionHandler = null;
         try {
-            if (null !== $this->exceptionHandler) {
-                return \call_user_func($this->exceptionHandler, $exception);
+            if (null !== $exceptionHandler) {
+                return \call_user_func($exceptionHandler, $exception);
             }
             $handlerException = $handlerException ?: $exception;
         } catch (\Exception $handlerException) {
         } catch (\Throwable $handlerException) {
         }
-        $this->exceptionHandler = null;
         if ($exception === $handlerException) {
             self::$reservedMemory = null; // Disable the fatal error handler
             throw $exception; // Give back $exception to the native handler