8000 [Routing] generate(null) should throw an exception · symfony/symfony@710aafb · GitHub
[go: up one dir, main page]

Skip to content

Commit 710aafb

Browse files
[Routing] generate(null) should throw an exception
1 parent 913781b commit 710aafb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function generate($name, $parameters = array(), $referenceType = self::AB
113113
?? $this->context->getParameter('_locale')
114114
?: $this->defaultLocale;
115115
116-
if (null !== $locale && (self::$declaredRoutes[$name.'.'.$locale][1]['_canonical_route'] ?? null) === $name) {
116+
if (null !== $locale && (self::$declaredRoutes[$name.'.'.$locale][1]['_canonical_route'] ?? null) === $name && null !== $name) {
117117
unset($parameters['_locale']);
118118
$name .= '.'.$locale;
119119
} elseif (!isset(self::$declaredRoutes[$name])) {

0 commit comments

Comments
 (0)
0