diff --git a/core/lib/Drupal/Core/Routing/UrlGenerator.php b/core/lib/Drupal/Core/Routing/UrlGenerator.php index c4276a3d224c934768562b9d858bc07fe88dd9cb..f56736ab267c569bec14f566ae07d1c348f11af7 100644 --- a/core/lib/Drupal/Core/Routing/UrlGenerator.php +++ b/core/lib/Drupal/Core/Routing/UrlGenerator.php @@ -7,7 +7,6 @@ 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 @@ protected function getRoute($name) { 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; }