Don't resize trash when no user

Happens when overwriting files on federated shares.
This commit is contained in:
Vincent Petry 2016-02-16 16:29:07 +01:00
parent 6c0e9211e9
commit 7bed529951
1 changed files with 5 additions and 2 deletions

View File

@ -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);
}
}
}