fix a bug where when an error would be thrown through the loader (Twig_Error_Loader...
authorNami-Doc <karp@hotmail.fr>
Sat, 31 Mar 2012 16:45:34 +0000 (19:45 +0300)
committerNami-Doc <karp@hotmail.fr>
Sat, 31 Mar 2012 16:45:34 +0000 (19:45 +0300)
lib/Twig/Error.php

index c1b9f32..45d164a 100755 (executable)
@@ -163,9 +163,11 @@ class Twig_Error extends Exception
 
     protected function guessTemplateLine($trace)
     {
-        foreach ($trace['object']->getDebugInfo() as $codeLine => $templateLine) {
-            if (isset($trace['line']) && $codeLine <= $trace['line']) {
-                return $templateLine;
+        if (isset($trace['line'])) {
+            foreach ($trace['object']->getDebugInfo() as $codeLine => $templateLine) {
+                if (isset($trace['line']) && $codeLine <= $trace['line']) {
+                    return $templateLine;
+                }
             }
         }