mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 04:16:28 +00:00
fixed toXml() method when some nodes are null
This commit is contained in:
@@ -79,6 +79,10 @@ class Twig_Node implements Twig_NodeInterface, ArrayAccess, Countable, Iterator
|
||||
}
|
||||
|
||||
foreach ($this->nodes as $name => $n) {
|
||||
if (null === $n) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$child = $n->toXml(true)->getElementsByTagName('node')->item(0);
|
||||
$child = $dom->importNode($child, true);
|
||||
$child->setAttribute('name', $name);
|
||||
|
||||
Reference in New Issue
Block a user