From: Fabien Potencier Date: Wed, 9 Jun 2010 14:03:58 +0000 (+0200) Subject: fixed toXml() method when some nodes are null X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=9519a084f18ddb2e772ca4be27c0bf834f364f55;p=web%2Fkonrad%2Ftwig.git fixed toXml() method when some nodes are null --- diff --git a/lib/Twig/Node.php b/lib/Twig/Node.php index 9fc162d..488918d 100644 --- a/lib/Twig/Node.php +++ b/lib/Twig/Node.php @@ -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);