mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-11 18:06:46 +00:00
fix a bug where when an error would be thrown through the loader (Twig_Error_Loader by Twig_Loader_Filesystem, ie) the $trace['line'] would not be set (since we're not in a template)
This commit is contained in:
+5
-3
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user