From 6e578d1c63f7db4ef3243bdf4781e14e8f36b0cc Mon Sep 17 00:00:00 2001 From: Savio Resende Date: Thu, 28 Dec 2023 15:00:37 -0600 Subject: [PATCH] Test timeout enhancement.7 --- src/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index 836f0cf..f995a92 100644 --- a/src/Client.php +++ b/src/Client.php @@ -116,7 +116,7 @@ public function connect(): void go(fn () => $this->startConnection()); go(fn () => Timer::tick(5000, function (int $timerId) { $this->pingTimer = $timerId; - if ($this->client->isConnected()) { + if ($this->getClient() && $this->getClient()->isConnected()) { $this->getClient()->ping(); } }));