diff --git a/lib/private/Collaboration/Collaborators/RemotePlugin.php b/lib/private/Collaboration/Collaborators/RemotePlugin.php index 99e23d471e091..f226715bfe9ce 100644 --- a/lib/private/Collaboration/Collaborators/RemotePlugin.php +++ b/lib/private/Collaboration/Collaborators/RemotePlugin.php @@ -30,7 +30,7 @@ public function __construct( private IUserManager $userManager, IUserSession $userSession, private IAppConfig $appConfig, - private TrustedServers $trustedServers, + private ?TrustedServers $trustedServers, ) { $this->userId = $userSession->getUser()?->getUID() ?? ''; $this->shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes'; @@ -107,7 +107,7 @@ public function search($search, $limit, $offset, ISearchResult $searchResult): b 'shareType' => IShare::TYPE_REMOTE, 'shareWith' => $cloudId, 'server' => $serverUrl, - 'isTrustedServer' => $this->trustedServers->isTrustedServer($serverUrl), + 'isTrustedServer' => $this->trustedServers?->isTrustedServer($serverUrl) ?? false, ], ]; } else { @@ -120,7 +120,7 @@ public function search($search, $limit, $offset, ISearchResult $searchResult): b 'shareType' => IShare::TYPE_REMOTE, 'shareWith' => $cloudId, 'server' => $serverUrl, - 'isTrustedServer' => $this->trustedServers->isTrustedServer($serverUrl), + 'isTrustedServer' => $this->trustedServers?->isTrustedServer($serverUrl) ?? false, ], ]; } @@ -147,7 +147,7 @@ public function search($search, $limit, $offset, ISearchResult $searchResult): b 'shareType' => IShare::TYPE_REMOTE, 'shareWith' => $search, 'server' => $serverUrl, - 'isTrustedServer' => $this->trustedServers->isTrustedServer($serverUrl), + 'isTrustedServer' => $this->trustedServers?->isTrustedServer($serverUrl) ?? false, ], ]; }