From 6b66b42f6e4399676677bd6f6534ad3c33c8404f Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Mon, 24 Mar 2014 12:33:44 +0100
Subject: [PATCH] catch the case where files_trashbin/files doesn't exist

---
 apps/files_trashbin/lib/trashbin.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php
index 62879b0ca8..7b14a4ec08 100644
--- a/apps/files_trashbin/lib/trashbin.php
+++ b/apps/files_trashbin/lib/trashbin.php
@@ -922,8 +922,11 @@ class Trashbin {
 
 		$view = new \OC\Files\View('/' . $user . '/files_trashbin');
 		$dh = $view->opendir('/files');
+		if (!$dh) {
+			return false;
+		}
 		while ($file = readdir($dh)) {
-			if($file !== '.' and $file !== '..'){
+			if ($file !== '.' and $file !== '..') {
 				return false;
 			}
 		}
-- 
GitLab