mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-19 21:59:59 -08:00
Sometimes the channel can be nil - we shouldn't crash in this situation
This commit is contained in:
parent
c109af8d88
commit
ebe189c524
1 changed files with 7 additions and 5 deletions
|
|
@ -401,11 +401,13 @@ func (server *Server) handlerLoop() {
|
|||
case vb := <-server.voicebroadcast:
|
||||
if vb.target == 0 { // Current channel
|
||||
channel := vb.client.Channel
|
||||
for _, client := range channel.clients {
|
||||
if client != vb.client {
|
||||
err := client.SendUDP(vb.buf)
|
||||
if err != nil {
|
||||
client.Panicf("Unable to send UDP: %v", err)
|
||||
if channel != nil {
|
||||
for _, client := range channel.clients {
|
||||
if client != vb.client {
|
||||
err := client.SendUDP(vb.buf)
|
||||
if err != nil {
|
||||
client.Panicf("Unable to send UDP: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue