Skip to content

Commit

Permalink
fix:修改一个id重复添加导致的panic
Browse files Browse the repository at this point in the history
  • Loading branch information
songzhibin97 committed Aug 31, 2021
1 parent 621485f commit abc6edf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/data/data_admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ func (a *Admin) HandlerWS(funcName string, options *websocket.AcceptOptions) fun
case <-client.GetCtx().Done():
c.Status(499)
return
case msg := <-client.MsgChan():
case msg, ok := <-client.MsgChan():
if !ok {
return
}
data, err := msg.Marshal()
if err != nil {
a.Logger.Error("Marshal error", zap.Any("err", err))
Expand Down

0 comments on commit abc6edf

Please sign in to comment.