diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-04-04 10:25:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-04 10:25:53 +0200 |
commit | 5c6f9ca278eaf7c097b3d454961d5a123a5644a4 (patch) | |
tree | 1e9217f9b269f79d29094a7b217918256e038682 /lib | |
parent | 3a0b70696cbc6596d489fc85979491950bd0c95e (diff) | |
parent | 56aa8fd0355879fed339e499b6c679d4cffd0913 (diff) | |
download | nextcloud-server-5c6f9ca278eaf7c097b3d454961d5a123a5644a4.tar.gz nextcloud-server-5c6f9ca278eaf7c097b3d454961d5a123a5644a4.zip |
Merge pull request #20284 from nextcloud/bugfix/noid/catch-no-user-in-cron
Properly catch NoUserException during upload cleanup
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Node/Root.php | 6 | ||||
-rw-r--r-- | lib/public/Files/IRootFolder.php | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/private/Files/Node/Root.php b/lib/private/Files/Node/Root.php index 843069ff50d..13c715816ef 100644 --- a/lib/private/Files/Node/Root.php +++ b/lib/private/Files/Node/Root.php @@ -35,6 +35,7 @@ use OC\Cache\CappedMemoryCache; use OC\Files\Mount\Manager; use OC\Files\Mount\MountPoint; use OC\Hooks\PublicEmitter; +use OC\User\NoUserException; use OCP\Files\Config\IUserMountCache; use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; @@ -352,7 +353,8 @@ class Root extends Folder implements IRootFolder { * * @param string $userId user ID * @return \OCP\Files\Folder - * @throws \OC\User\NoUserException + * @throws NoUserException + * @throws NotPermittedException */ public function getUserFolder($userId) { $userObject = $this->userManager->get($userId); @@ -367,7 +369,7 @@ class Root extends Folder implements IRootFolder { 'app' => 'files', ] ); - throw new \OC\User\NoUserException('Backends provided no user object'); + throw new NoUserException('Backends provided no user object'); } $userId = $userObject->getUID(); diff --git a/lib/public/Files/IRootFolder.php b/lib/public/Files/IRootFolder.php index 5304414ae7b..0d568f9045e 100644 --- a/lib/public/Files/IRootFolder.php +++ b/lib/public/Files/IRootFolder.php @@ -25,6 +25,7 @@ namespace OCP\Files; use OC\Hooks\Emitter; +use OC\User\NoUserException; /** * Interface IRootFolder @@ -39,6 +40,9 @@ interface IRootFolder extends Folder, Emitter { * * @param string $userId user ID * @return \OCP\Files\Folder + * @throws NoUserException + * @throws NotPermittedException + * * @since 8.2.0 */ public function getUserFolder($userId); |