fix bug :KickUserOffline panic: runtime error: invalid memory address or nil pointer dereference

This commit is contained in:
skiffer-git
2022-09-18 10:50:51 +08:00
parent 93cb01e7e6
commit db8763b610
3 changed files with 12 additions and 5 deletions
@@ -323,7 +323,7 @@ func (r *RPCServer) KickUserOffline(_ context.Context, req *pbRelay.KickUserOffl
oldConnMap := ws.getUserAllCons(v)
if conn, ok := oldConnMap[int(req.PlatformID)]; ok { // user->map[platform->conn]
log.NewWarn(req.OperationID, "send kick msg, close connection ", req.PlatformID, v)
ws.sendKickMsg(conn, &UserConn{})
ws.sendKickMsg(conn)
conn.Close()
}
}