diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-17 10:57:50 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-17 10:57:50 +0100 |
commit | ff4e040971374d372407e0447623670ab79758c5 (patch) | |
tree | ee9975a905671cb6d52297f906249cc98f382dbe | |
parent | f6dcc9d615870cb194b3ebfe42c25044e1a94519 (diff) | |
parent | 7bed529951110b173a6a8e8a49b774c2d5e5ab19 (diff) | |
download | nextcloud-server-ff4e040971374d372407e0447623670ab79758c5.tar.gz nextcloud-server-ff4e040971374d372407e0447623670ab79758c5.zip |
Merge pull request #22435 from owncloud/trashbin-hook-nouser
Don't resize trash when no user
-rw-r--r-- | apps/files_trashbin/lib/hooks.php | 7 |
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); + } } } |