Skip to content

Commit 142d481

Browse files
committed
Merge branch '4.4' into 5.4
* 4.4: Added Urdu Language Translation in Form Component, Security Core and in Validator Component Merge upgrade notes for Serializer component Throw LogicException instead of Error when trying to generate logout-URL without request
2 parents c18f358 + 41e7666 commit 142d481

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Logout/LogoutUrlGenerator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ private function generateLogoutUrl(?string $key, int $referenceType): string
101101

102102
$request = $this->requestStack->getCurrentRequest();
103103

104+
if (!$request) {
105+
throw new \LogicException('Unable to generate the logout URL without a Request.');
106+
}
107+
104108
$url = UrlGeneratorInterface::ABSOLUTE_URL === $referenceType ? $request->getUriForPath($logoutPath) : $request->getBaseUrl().$logoutPath;
105109

106110
if (!empty($parameters)) {

0 commit comments

Comments
 (0)