fixed potential exception
authorFabien Potencier <fabien.potencier@gmail.com>
Sat, 5 Jul 2014 11:16:15 +0000 (13:16 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Sat, 5 Jul 2014 11:16:15 +0000 (13:16 +0200)
lib/Twig/Node/Expression/Call.php

index d019696..912b837 100644 (file)
@@ -12,10 +12,8 @@ abstract class Twig_Node_Expression_Call extends Twig_Node_Expression
 {
     protected function compileCallable(Twig_Compiler $compiler)
     {
-        $callable = $this->getAttribute('callable');
-
         $closingParenthesis = false;
-        if ($callable) {
+        if ($this->hasAttribute('callable') && $callable = $this->getAttribute('callable')) {
             if (is_string($callable)) {
                 $compiler->raw($callable);
             } elseif (is_array($callable) && $callable[0] instanceof Twig_ExtensionInterface) {