Fix ModuleNode instanciation when $embeddedTemplates is null

This commit is contained in:
Alexandre Daubois
2025-02-28 20:12:40 +01:00
parent d6c1112f96
commit 81c1fcc7d6
+1 -1
View File
@@ -41,7 +41,7 @@ final class ModuleNode extends Node
if (!$embeddedTemplates instanceof Node) {
trigger_deprecation('twig/twig', '3.21', \sprintf('Not passing a "%s" instance as the "embedded_templates" argument of the "%s" constructor is deprecated.', Node::class, static::class));
$embeddedTemplates = new Nodes($embeddedTemplates);
$embeddedTemplates = new Nodes($embeddedTemplates ?? []);
}
$nodes = [