@@ -52,6 +52,10 @@ public function hasTeamSupport(): bool {
5252 }
5353
5454 public function getProviders (): array {
55+ if (!$ this ->hasTeamSupport ()) {
56+ return [];
57+ }
58+
5559 if ($ this ->providers !== null ) {
5660 return $ this ->providers ;
5761 }
@@ -78,6 +82,10 @@ public function getProvider(string $providerId): ITeamResourceProvider {
7882 }
7983
8084 public function getSharedWith (string $ teamId , string $ userId ): array {
85+ if (!$ this ->hasTeamSupport ()) {
86+ return [];
87+ }
88+
8189 if ($ this ->getTeam ($ teamId , $ userId ) === null ) {
8290 return [];
8391 }
@@ -92,6 +100,10 @@ public function getSharedWith(string $teamId, string $userId): array {
92100 }
93101
94102 public function getTeamsForResource (string $ providerId , string $ resourceId , string $ userId ): array {
103+ if (!$ this ->hasTeamSupport ()) {
104+ return [];
105+ }
106+
95107 $ provider = $ this ->getProvider ($ providerId );
96108 return array_values (array_filter (array_map (function ($ teamId ) use ($ userId ) {
97109 $ team = $ this ->getTeam ($ teamId , $ userId );
@@ -108,6 +120,10 @@ public function getTeamsForResource(string $providerId, string $resourceId, stri
108120 }
109121
110122 private function getTeam (string $ teamId , string $ userId ): ?Circle {
123+ if (!$ this ->hasTeamSupport ()) {
124+ return null ;
125+ }
126+
111127 try {
112128 $ federatedUser = $ this ->circlesManager ->getFederatedUser ($ userId , Member::TYPE_USER );
113129 $ this ->circlesManager ->startSession ($ federatedUser );
0 commit comments