diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-03-06 14:20:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-06 14:20:25 +0100 |
commit | 394ad988c7157c0f576b78d591e48e330fe6ca7f (patch) | |
tree | 9a1062050dc44f03674d10e6c9e236a36c8459aa /apps | |
parent | eddc6f2103665d985a9e541b16d61fab5ba6a1ee (diff) | |
parent | c02080fccb7d87507b2be608bed1cc66096b6506 (diff) | |
download | nextcloud-server-394ad988c7157c0f576b78d591e48e330fe6ca7f.tar.gz nextcloud-server-394ad988c7157c0f576b78d591e48e330fe6ca7f.zip |
Merge pull request #36904 from nextcloud/bugfix/noid/fix-controller-setup-for-guests
fix(files): Fix controller setup for guests
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/lib/Service/TagService.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/apps/files/lib/Service/TagService.php b/apps/files/lib/Service/TagService.php index 29b6fbc2840..0ea60ec09d8 100644 --- a/apps/files/lib/Service/TagService.php +++ b/apps/files/lib/Service/TagService.php @@ -42,24 +42,17 @@ class TagService { private $userSession; /** @var IManager */ private $activityManager; - /** @var ITags */ + /** @var ITags|null */ private $tagger; /** @var Folder */ private $homeFolder; /** @var EventDispatcherInterface */ private $dispatcher; - /** - * @param IUserSession $userSession - * @param IManager $activityManager - * @param ITags $tagger - * @param Folder $homeFolder - * @param EventDispatcherInterface $dispatcher - */ public function __construct( IUserSession $userSession, IManager $activityManager, - ITags $tagger, + ?ITags $tagger, Folder $homeFolder, EventDispatcherInterface $dispatcher ) { @@ -81,6 +74,10 @@ class TagService { * @throws \OCP\Files\NotFoundException if the file does not exist */ public function updateFileTags($path, $tags) { + if ($this->tagger === null) { + throw new \RuntimeException('No tagger set'); + } + $fileId = $this->homeFolder->get($path)->getId(); $currentTags = $this->tagger->getTagsForObjects([$fileId]); |