diff --git a/lib/private/Teams/TeamManager.php b/lib/private/Teams/TeamManager.php index d75b0209c7187..d3ef286ae1da3 100644 --- a/lib/private/Teams/TeamManager.php +++ b/lib/private/Teams/TeamManager.php @@ -18,6 +18,7 @@ use OCP\Teams\Team; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; +use Psr\Log\LoggerInterface; class TeamManager implements ITeamManager { @@ -28,6 +29,7 @@ public function __construct( private Coordinator $bootContext, private IURLGenerator $urlGenerator, private ?CirclesManager $circlesManager, + private LoggerInterface $logger, ) { } @@ -88,7 +90,12 @@ public function getTeamsForResource(string $providerId, string $resourceId, stri return []; } - $provider = $this->getProvider($providerId); + try { + $provider = $this->getProvider($providerId); + } catch (\RuntimeException $e) { + $this->logger->info($e->getMessage(), ['exception' => $e]); + return []; + } return array_values(array_filter(array_map(function ($teamId) use ($userId) { $team = $this->getTeam($teamId, $userId); if ($team === null) { diff --git a/lib/public/Teams/ITeamManager.php b/lib/public/Teams/ITeamManager.php index 144a141f93eb7..844e4d00d34ed 100644 --- a/lib/public/Teams/ITeamManager.php +++ b/lib/public/Teams/ITeamManager.php @@ -6,6 +6,8 @@ namespace OCP\Teams; +use RuntimeException; + /** * @since 29.0.0 */ @@ -21,6 +23,7 @@ public function getProviders(): array; /** * Get a specific team resource provider by its id * + * @throws RuntimeException * @since 29.0.0 */ public function getProvider(string $providerId): ITeamResourceProvider;