Calculate size for existing directories only

This commit is contained in:
Victor Dubiniuk 2013-02-18 23:48:08 +03:00
parent c8e02060c1
commit e2f87e456f
1 changed files with 3 additions and 0 deletions

View File

@ -396,6 +396,9 @@ class Trashbin {
*/
private static function calculateSize($view) {
$root = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath('');
if (!file_exists($root)) {
return 0;
}
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($root), \RecursiveIteratorIterator::CHILD_FIRST);
$size = 0;