Skip to content

[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

Merged
merged 1 commit into from
Jan 6, 2024

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Jan 5, 2024

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #53430
License MIT

Copy link
Contributor

@radar3301 radar3301 left a 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,
Copy link
Member

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:

Suggested change
'logger' => class_exists(DebugLoggerConfigurator::class) ? DebugLoggerConfigurator::getDebugLogger($this->logger) : null,
'logger' => ($this->logger && class_exists(DebugLoggerConfigurator::class)) ? DebugLoggerConfigurator::getDebugLogger($this->logger) : null,

Copy link
Member Author

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

@fabpot
Copy link
Member

fabpot commented Jan 6, 2024

Thank you @xabbuh.

@fabpot fabpot merged commit a1ca059 into symfony:6.4 Jan 6, 2024
@xabbuh xabbuh deleted the issue-53430 branch January 6, 2024 12:30
@radar3301
Copy link
Contributor

radar3301 commented Jan 8, 2024

Just checking... Will this get merged automatically into 7.0 and 7.1?

Nevermind, I just saw that it did.

This was referenced Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants