From 39cf1d3a2741e979ee94ea94f479e173a4437067 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 28 Apr 2009 18:10:16 +0000 Subject: Removed foreach warnings on empty arrays. --- utils/modules/icons.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'utils/modules/icons.php') diff --git a/utils/modules/icons.php b/utils/modules/icons.php index 44df7e9..3a9d716 100644 --- a/utils/modules/icons.php +++ b/utils/modules/icons.php @@ -110,13 +110,15 @@ class Icons { public function Icons($prefix) { $this->prefix = $prefix; - $df = opendir($prefix); - while(false !== ($file = readdir($df))) { - if($file == '.' || $file == '..') continue; - $icon = new Icon($file, $prefix); - $this->icons[$file] = $icon; + if(is_dir($prefix)) { + $df = opendir($prefix); + while(false !== ($file = readdir($df))) { + if($file == '.' || $file == '..') continue; + $icon = new Icon($file, $prefix); + $this->icons[$file] = $icon; + } + closedir($df); } - closedir($df); } } -- cgit v1.2.3