Skip to content

Commit

Permalink
[ErrorHandler] fix setting $trace to null in FatalError
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed May 28, 2020
1 parent 5fe0f94 commit aa50c92
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Symfony/Component/ErrorHandler/Error/FatalError.php
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit aa50c92

Please sign in to comment.