소스 검색

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') {