Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
bug #29191 [Routing] generate(null) should throw an exception (nicola…
…s-grekas)

This PR was merged into the 4.1 branch.

Discussion
----------

[Routing] generate(null) should throw an exception

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #28634
| License       | MIT
| Doc PR        | -

Commits
-------

710aafb [Routing] generate(null) should throw an exception
  • Loading branch information
nicolas-grekas committed Nov 13, 2018
2 parents 28cd88e + 710aafb commit c96325f
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -113,7 +113,7 @@ public function generate($name, $parameters = array(), $referenceType = self::AB
?? $this->context->getParameter('_locale')
?: $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']);
$name .= '.'.$locale;
} elseif (!isset(self::$declaredRoutes[$name])) {
Expand Down

0 comments on commit c96325f

Please sign in to comment.