From 0df9a23c0f9eddbb6682479fee6fd58b88add75b Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 28 May 2020 12:36:45 +0200 Subject: [PATCH] [ErrorHandler] fix setting $trace to null in FatalError --- Error/FatalError.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Error/FatalError.php b/Error/FatalError.php index 68172d8..98490b5 100644 --- a/Error/FatalError.php +++ b/Error/FatalError.php @@ -72,9 +72,11 @@ public function __construct(string $message, int $code, array $error, int $trace 'line' => $error['line'], 'trace' => $trace, ] as $property => $value) { - $refl = new \ReflectionProperty(\Error::class, $property); - $refl->setAccessible(true); - $refl->setValue($this, $value); + if (null !== $value) { + $refl = new \ReflectionProperty(\Error::class, $property); + $refl->setAccessible(true); + $refl->setValue($this, $value); + } } }