summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/files_trashbin/lib/trashbin.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php
index 7b14a4ec081..bf8d465e5de 100644
--- a/apps/files_trashbin/lib/trashbin.php
+++ b/apps/files_trashbin/lib/trashbin.php
@@ -921,13 +921,11 @@ class Trashbin {
public static function isEmpty($user) {
$view = new \OC\Files\View('/' . $user . '/files_trashbin');
- $dh = $view->opendir('/files');
- if (!$dh) {
- return false;
- }
- while ($file = readdir($dh)) {
- if ($file !== '.' and $file !== '..') {
- return false;
+ if ($view->is_dir('/files') && $dh = $view->opendir('/files')) {
+ while ($file = readdir($dh)) {
+ if ($file !== '.' and $file !== '..') {
+ return false;
+ }
}
}
return true;