diff --git a/inc/inc.Utils.php b/inc/inc.Utils.php index aef0352bf..8342681f7 100644 --- a/inc/inc.Utils.php +++ b/inc/inc.Utils.php @@ -296,11 +296,12 @@ function dskspace($dir) { /* {{{ */ if(is_file($dir)) { $space = filesize($dir); } elseif (is_dir($dir)) { - $dh = opendir($dir); - while (($file = readdir($dh)) !== false) - if ($file != "." and $file != "..") - $space += dskspace($dir."/".$file); - closedir($dh); + if($dh = opendir($dir)) { + while (($file = readdir($dh)) !== false) + if ($file != "." and $file != "..") + $space += dskspace($dir."/".$file); + closedir($dh); + } } return $space; } /* }}} */