diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-02-16 16:29:07 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-02-16 16:29:07 +0100 |
commit | 7bed529951110b173a6a8e8a49b774c2d5e5ab19 (patch) | |
tree | 23ab75bc002e782e83f7361dc42f38aeceb1bb5f /apps/files_trashbin/lib | |
parent | 6c0e9211e93abfe48d187b91f9d2e9c30566aebc (diff) | |
download | nextcloud-server-7bed529951110b173a6a8e8a49b774c2d5e5ab19.tar.gz nextcloud-server-7bed529951110b173a6a8e8a49b774c2d5e5ab19.zip |
Don't resize trash when no user
Happens when overwriting files on federated shares.
Diffstat (limited to 'apps/files_trashbin/lib')
-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); + } } } |