Skip to content

Commit

Permalink
Merge pull request #1048 from nextcloud/fix/noid/circle-link-no-contacts
Browse files Browse the repository at this point in the history
do not generate link if no front-end
  • Loading branch information
ArtificialOwl committed Jun 13, 2022
2 parents 0f675b3 + b8493f3 commit 70b4e99
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/Model/ModelManager.php
Expand Up @@ -31,7 +31,7 @@

namespace OCA\Circles\Model;

use OCA\Circles\Tools\Traits\TNCLogger;
use Exception;
use OCA\Circles\AppInfo\Application;
use OCA\Circles\Db\CircleRequest;
use OCA\Circles\Db\CoreQueryBuilder;
Expand All @@ -57,6 +57,7 @@
use OCA\Circles\Service\InterfaceService;
use OCA\Circles\Service\MembershipService;
use OCA\Circles\Service\RemoteService;
use OCA\Circles\Tools\Traits\TNCLogger;
use OCP\IURLGenerator;

/**
Expand Down Expand Up @@ -553,10 +554,16 @@ public function fixInstance(string $instance): string {
* @return string
*/
public function generateLinkToCircle(string $singleId): string {
return $this->urlGenerator->linkToRoute(
$this->configService->getAppValue(ConfigService::ROUTE_TO_CIRCLE),
['singleId' => $singleId]
);
$path = $this->configService->getAppValue(ConfigService::ROUTE_TO_CIRCLE);

try {
if ($path !== '') {
return $this->urlGenerator->linkToRoute($path, ['singleId' => $singleId]);
}
} catch (Exception $e) {
}

return '';
}


Expand Down

0 comments on commit 70b4e99

Please sign in to comment.