From 2db8aebd5280f6bf23fd9cedc0e8a969e1daf770 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Thu, 4 Nov 2010 12:33:48 +0100 Subject: [PATCH] Prevents error when displaying site errors. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- classes/plerrorreport.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classes/plerrorreport.php b/classes/plerrorreport.php index 520acf0..194cd1b 100644 --- a/classes/plerrorreport.php +++ b/classes/plerrorreport.php @@ -74,7 +74,12 @@ class PlErrorReportIterator implements PlIterator public function __construct() { - $this->file = fopen(Platal::globals()->spoolroot . '/spool/tmp/site_errors', 'r'); + $file = Platal::globals()->spoolroot . '/spool/tmp/site_errors'; + if (file_exists($file)) { + $this->file = fopen($file, 'r'); + } else { + $this->file = null; + } } public function next() -- 2.1.4