From f79a56b431a3e6afa66ac8799ee7e25838059328 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 22 Apr 2012 08:56:25 +0200 Subject: [PATCH] fixed compatibility with PHP 5.2 and simplify code a bit --- lib/Twig/Error.php | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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; } -- 1.7.2.5