Closed
Description
Symfony version(s) affected
4.4.45
Description
Before an issue, we had a good error message.
After an issue in every error, we have "Call to a member function getBaseUrl() on null"
If the comment finally parts, it again works.
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$this->finishRequest($request, $type);
throw $e;
}
return $this->handleThrowable($e, $request, $type);
// } finally {
// $this->requestStack->pop();
}
}
How to reproduce
- Open any existing project
- Autowire in method (entity property + any class which needed to have entity object but it will return null because not found record).
- With SF 4.4.45 we will get strange error "Call to a member function getBaseUrl() on null"
- composer.json add
"symfony/http-kernel": "4.4.44"
- Run composer up (downgrade symfony/http-kernel" and works again.
Possible Solution
Finally section works not property.
Additional Context
No response