From e2f87e456f05ecafeefff29a1e2bf996f692a050 Mon Sep 17 00:00:00 2001
From: Victor Dubiniuk <victor.dubiniuk@gmail.com>
Date: Mon, 18 Feb 2013 23:48:08 +0300
Subject: [PATCH] Calculate size for existing directories only

---
 apps/files_trashbin/lib/trash.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php
index 76844ca92e..fbc3954c04 100644
--- a/apps/files_trashbin/lib/trash.php
+++ b/apps/files_trashbin/lib/trash.php
@@ -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;
 		
-- 
GitLab