-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[ErrorHandler] fix rendering exception pages without the HttpKernel component #53434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
xabbuh
commented
Jan 5, 2024
Q | A |
---|---|
Branch? | 6.4 |
Bug fix? | yes |
New feature? | no |
Deprecations? | no |
Issues | Fix #53430 |
License | MIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$this->logger && class_exists
@@ -140,7 +140,7 @@ private function renderException(FlattenException $exception, string $debugTempl | |||
'exceptionMessage' => $exceptionMessage, | |||
'statusText' => $statusText, | |||
'statusCode' => $statusCode, | |||
'logger' => DebugLoggerConfigurator::getDebugLogger($this->logger), | |||
'logger' => class_exists(DebugLoggerConfigurator::class) ? DebugLoggerConfigurator::getDebugLogger($this->logger) : null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@radar3301 suggested a small optimization that makes sense to me:
'logger' => class_exists(DebugLoggerConfigurator::class) ? DebugLoggerConfigurator::getDebugLogger($this->logger) : null, | |
'logger' => ($this->logger && class_exists(DebugLoggerConfigurator::class)) ? DebugLoggerConfigurator::getDebugLogger($this->logger) : null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a check for the property not being null
Thank you @xabbuh. |
Nevermind, I just saw that it did. |