Skip to content

Commit

Permalink
Merge pull request #1062 from nextcloud/backport/1048/stable22
Browse files Browse the repository at this point in the history
[stable22] do not generate link if no front-end
  • Loading branch information
ArtificialOwl authored Jun 13, 2022
2 parents e3fa4d2 + daa42e5 commit 8944406
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/Model/ModelManager.php
Original file line number Diff line number Diff line change
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 @@ -56,6 +56,7 @@
use OCA\Circles\Service\ConfigService;
use OCA\Circles\Service\InterfaceService;
use OCA\Circles\Service\RemoteService;
use OCA\Circles\Tools\Traits\TNCLogger;
use OCP\IURLGenerator;

/**
Expand Down Expand Up @@ -532,10 +533,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 8944406

Please sign in to comment.