From 475f9b9033b6419388ac10d025b62982dc0e8ea0 Mon Sep 17 00:00:00 2001 From: Jurij Date: Sat, 16 Dec 2023 02:34:11 +0100 Subject: [PATCH] Popravki ce ni config vrednosti --- web/modules/custom/etherpad_api/src/Client.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/modules/custom/etherpad_api/src/Client.php b/web/modules/custom/etherpad_api/src/Client.php index 975aa74..daa88e3 100644 --- a/web/modules/custom/etherpad_api/src/Client.php +++ b/web/modules/custom/etherpad_api/src/Client.php @@ -41,12 +41,15 @@ class Client { public function __construct(ClientInterface $httpClient, ImmutableConfig $config) { $this->httpClient = $httpClient; $this->config = $config; - $this->baseUrl = rtrim($config->get('url'), '/'); + $this->baseUrl = $config->get('url') ? rtrim($config->get('url'), '/') : null; $this->apiKey = $config->get('key'); } public function checkToken() { - return $this->request('get', 'checkToken'); + if ($this->baseUrl) { + return $this->request('checkToken'); + } + return false; } /**