diff --git a/lib/Share/Listener.php b/lib/Share/Listener.php index 2f1d5bdf119..5d091cace7e 100644 --- a/lib/Share/Listener.php +++ b/lib/Share/Listener.php @@ -60,20 +60,16 @@ protected function overwriteMountPoint(VerifyMountPointEvent $event): void { } if ($event->getParent() === RoomShareProvider::TALK_FOLDER_PLACEHOLDER) { - try { - $userId = $view->getOwner('/'); - } catch (\Exception $e) { - // If we fail to get the owner of the view from the cache, - // e.g. because the user never logged in but a cron job runs - // We fall back to calculating the owner from the root of the view: - if (substr_count($view->getRoot(), '/') >= 2) { - // /37c09aa0-1b92-4cf6-8c66-86d8cac8c1d0/files - [, $userId, ] = explode('/', $view->getRoot(), 3); - } else { - // Something weird is going on, we can't fall back more - // so for now we don't overwrite the share path ¯\_(ツ)_/¯ - return; - } + // If we fail to get the owner of the view from the cache, + // e.g. because the user never logged in but a cron job runs + // We fall back to calculating the owner from the root of the view: + if (substr_count($view->getRoot(), '/') >= 2) { + // /37c09aa0-1b92-4cf6-8c66-86d8cac8c1d0/files + [, $userId, ] = explode('/', $view->getRoot(), 3); + } else { + // Something weird is going on, we can't fall back more + // so for now we don't overwrite the share path ¯\_(ツ)_/¯ + return; } $parent = $this->config->getAttachmentFolder($userId); diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index fe2d7771ba7..5e6d48bb75c 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -1,5 +1,5 @@ - + @@ -159,7 +159,6 @@ getView()]]> -