瀏覽代碼

Check $this->eventLoop empty

walkor 1 年之前
父節點
當前提交
310f582f15
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Connection/AsyncTcpConnection.php

+ 1 - 1
src/Connection/AsyncTcpConnection.php

@@ -365,7 +365,7 @@ class AsyncTcpConnection extends TcpConnection
     public function checkConnection(): void
     {
         // Remove EV_EXPECT for windows.
-        if (DIRECTORY_SEPARATOR === '\\' && method_exists($this->eventLoop, 'offExcept')) {
+        if (DIRECTORY_SEPARATOR === '\\' && $this->eventLoop && method_exists($this->eventLoop, 'offExcept')) {
             $this->eventLoop->offExcept($this->socket);
         }
         // Remove write listener.