Skip to content

Commit abc6edf

Browse files
committed
fix:修改一个id重复添加导致的panic
1 parent 621485f commit abc6edf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/data/data_admin.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ func (a *Admin) HandlerWS(funcName string, options *websocket.AcceptOptions) fun
8787
case <-client.GetCtx().Done():
8888
c.Status(499)
8989
return
90-
case msg := <-client.MsgChan():
90+
case msg, ok := <-client.MsgChan():
91+
if !ok {
92+
return
93+
}
9194
data, err := msg.Marshal()
9295
if err != nil {
9396
a.Logger.Error("Marshal error", zap.Any("err", err))

0 commit comments

Comments
 (0)