Skip to content

Commit

Permalink
客户端不存在,直接返回
Browse files Browse the repository at this point in the history
  • Loading branch information
link1st committed Aug 3, 2019
1 parent 795867e commit dab539f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions servers/websocket/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ func (c *Client) write() {

// 读取客户端数据
func (c *Client) SendMsg(msg []byte) {

if c == nil {

return
}

defer func() {
if r := recover(); r != nil {
fmt.Println("SendMsg stop:", r, string(debug.Stack()))
Expand Down

0 comments on commit dab539f

Please sign in to comment.