[Routing] generate(null) should throw an exception

This commit is contained in:
Nicolas Grekas 2018-11-12 17:52:50 +01:00
parent 913781baac
commit 710aafbc91
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ EOF;
?? $this->context->getParameter('_locale') ?? $this->context->getParameter('_locale')
?: $this->defaultLocale; ?: $this->defaultLocale;
if (null !== $locale && (self::$declaredRoutes[$name.'.'.$locale][1]['_canonical_route'] ?? null) === $name) { if (null !== $locale && (self::$declaredRoutes[$name.'.'.$locale][1]['_canonical_route'] ?? null) === $name && null !== $name) {
unset($parameters['_locale']); unset($parameters['_locale']);
$name .= '.'.$locale; $name .= '.'.$locale;
} elseif (!isset(self::$declaredRoutes[$name])) { } elseif (!isset(self::$declaredRoutes[$name])) {