Issue #3184619 by neclimdul, quietone: Fix unreachable logic in UrlGenerator::getRoute

merge-requests/1763/head
catch 2021-11-22 17:11:24 +00:00
parent da17876671
commit 3730c17b80
1 changed files with 2 additions and 3 deletions

View File

@ -7,7 +7,6 @@ use Drupal\Core\Render\BubbleableMetadata;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Routing\RequestContext as SymfonyRequestContext;
use Symfony\Component\Routing\Route as SymfonyRoute;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\PathProcessor\OutboundPathProcessorInterface;
use Drupal\Core\RouteProcessor\OutboundRouteProcessorInterface;
@ -423,8 +422,8 @@ class UrlGenerator implements UrlGeneratorInterface {
if ($name instanceof SymfonyRoute) {
$route = $name;
}
elseif (NULL === $route = clone $this->provider->getRouteByName($name)) {
throw new RouteNotFoundException(sprintf('Route "%s" does not exist.', $name));
else {
$route = clone $this->provider->getRouteByName($name);
}
return $route;
}