fixed Parser bug when a child node is null
authorFabien Potencier <fabien.potencier@gmail.com>
Thu, 28 Jul 2011 12:32:45 +0000 (14:32 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Thu, 28 Jul 2011 12:32:45 +0000 (14:32 +0200)
lib/Twig/Parser.php

index 0649c7b..057c1e8 100644 (file)
@@ -310,7 +310,7 @@ class Twig_Parser implements Twig_ParserInterface
         }
 
         foreach ($node as $k => $n) {
-            if ($n instanceof Twig_NodeInterface && null === $n = $this->filterBodyNodes($n)) {
+            if (null !== $n && null === $n = $this->filterBodyNodes($n)) {
                 $node->removeNode($k);
             }
         }