瀏覽代碼

no message

kuaifan 5 年之前
父節點
當前提交
0a23d54087
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/Services/WebSocketService.php

+ 3 - 1
app/Services/WebSocketService.php

@@ -331,7 +331,9 @@ class WebSocketService implements WebSocketHandlerInterface
                 }
                 //
                 Cache::put("docs::" . $sid, Base::array2json($array), 30);
-                ksort($array);
+                if ($array) {
+                    ksort($array);
+                }
                 $back['message'] = array_values($array);
                 //
                 if ($type == 'enter' || $type == 'quit') {