summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/lib/hooks.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/files_trashbin/lib/hooks.php b/apps/files_trashbin/lib/hooks.php
index 0a018f4f0f8..9fb6c162b6c 100644
--- a/apps/files_trashbin/lib/hooks.php
+++ b/apps/files_trashbin/lib/hooks.php
@@ -40,10 +40,13 @@ class Hooks {
if( \OCP\App::isEnabled('files_trashbin') ) {
$uid = $params['uid'];
Trashbin::deleteUser($uid);
- }
+ }
}
public static function post_write_hook($params) {
- Trashbin::resizeTrash(\OCP\User::getUser());
+ $user = \OCP\User::getUser();
+ if (!empty($user)) {
+ Trashbin::resizeTrash($user);
+ }
}
}