Skip to content

Commit

Permalink
do not generate link if no front-end
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl committed Jun 24, 2022
1 parent da369e2 commit 3054b1b
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 @@ -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 3054b1b

Please sign in to comment.