diff --git a/src/Client.php b/src/Client.php index 67f6a47..a121624 100644 --- a/src/Client.php +++ b/src/Client.php @@ -201,7 +201,7 @@ protected function handleClientConnection(): void $this->connectionReady(); try { - while ($message = $this->client->receive()) { + while ($this->client && $message = $this->client->receive()) { if (null === $this->onMessageCallback) { continue; }