diff --git a/lib/Model/ModelManager.php b/lib/Model/ModelManager.php index 175214b90..6073add26 100644 --- a/lib/Model/ModelManager.php +++ b/lib/Model/ModelManager.php @@ -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; @@ -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; /** @@ -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 ''; }