10000 bug #10067 [HttpKernel] allow null value in fragment handler (kbond) · benji07/symfony@783a45d · GitHub
[go: up one dir, main page]

Skip to content

Commit 783a45d

Browse files
committed
bug symfony#10067 [HttpKernel] allow null value in fragment handler (kbond)
This PR was submitted for the 2.4-dev branch but it was merged into the 2.4 branch instead (closes symfony#10067). Discussion ---------- [HttpKernel] allow null value in fragment handler | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#10066 | License | MIT | Doc PR | n/a Commits ------- 534deef [HttpKernel] allow null value in fragment handler
2 parents 2f8d4ad + c29958f commit 783a45d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ private function checkNonScalar($values)
8282
foreach ($values as $key => $value) {
8383
if (is_array($value)) {
8484
$this->checkNonScalar($value);
85-
} elseif (!is_scalar($value)) {
86-
throw new \LogicException(sprintf('Controller attributes cannot contain non-scalar values (value for key "%s" is not a scalar).', $key));
85+
} elseif (!is_scalar($value) && null !== $value) {
86+
throw new \LogicException(sprintf('Controller attributes cannot contain non-scalar/non-null values (value for key "%s" is not a scalar or null).', $key));
8787
}
8888
}
8989
}

0 commit comments

Comments
 (0)
0