fixed inherited templates when an empty body
authorFabien Potencier <fabien.potencier@gmail.com>
Tue, 26 Jul 2011 15:32:54 +0000 (17:32 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Tue, 26 Jul 2011 15:32:54 +0000 (17:32 +0200)
lib/Twig/Parser.php

index fc41374..fea244e 100644 (file)
@@ -81,7 +81,9 @@ class Twig_Parser implements Twig_ParserInterface
             $body = $this->subparse(null);
 
             if (null !== $this->parent) {
-                $body = $this->filterBodyNodes($body);
+                if (null === $body = $this->filterBodyNodes($body)) {
+                    $body = new Twig_Node();
+                }
             }
         } catch (Twig_Error_Syntax $e) {
             if (null === $e->getTemplateFile()) {