Skip to content

Commit 6d3cd40

Browse files
committed
Fix null check on lazy_builder callback
1 parent 4f91030 commit 6d3cd40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Rules/Drupal/RenderCallbackRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function processNode(Node $node, Scope $scope): array
8383
continue;
8484
}
8585

86-
if (count($item->value->items) !== 2) {
86+
if (count($item->value->items) !== 2 || $item->value->items[0] === null) {
8787
$errors[] = RuleErrorBuilder::message(
8888
sprintf("%s callback %s at key '%s' is not valid. First value must be a callback and second value its arguments.", $keyChecked, $scope->getType($item->value)->describe(VerbosityLevel::value()), $pos)
8989
)->line($item->value->getLine())->build();

0 commit comments

Comments
 (0)