From: Fabien Potencier Date: Sun, 22 Apr 2012 06:56:25 +0000 (+0200) Subject: fixed compatibility with PHP 5.2 and simplify code a bit X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=f79a56b431a3e6afa66ac8799ee7e25838059328;p=web%2Fkonrad%2Ftwig.git fixed compatibility with PHP 5.2 and simplify code a bit --- diff --git a/lib/Twig/Error.php b/lib/Twig/Error.php index a2ffd35..e32c5c9 100644 --- a/lib/Twig/Error.php +++ b/lib/Twig/Error.php @@ -172,7 +172,7 @@ class Twig_Error extends Exception $file = $r->getFileName(); $exceptions = array($e = $this); - while ($e = $e->getPrevious()) { + while (method_exists($e, 'getPrevious') && $e = $e->getPrevious()) { $exceptions[] = $e; }