Skip to content

HttpKernel broken #47927

Closed
Closed
@StaffNowa

Description

@StaffNowa

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

  1. Open any existing project
  2. Autowire in method (entity property + any class which needed to have entity object but it will return null because not found record).
  3. With SF 4.4.45 we will get strange error "Call to a member function getBaseUrl() on null"
  4. composer.json add "symfony/http-kernel": "4.4.44"
  5. Run composer up (downgrade symfony/http-kernel" and works again.

Possible Solution

Finally section works not property.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions