mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-21 02:21:58 -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,6 +401,7 @@ func (server *Server) handlerLoop() {
|
||||||
case vb := <-server.voicebroadcast:
|
case vb := <-server.voicebroadcast:
|
||||||
if vb.target == 0 { // Current channel
|
if vb.target == 0 { // Current channel
|
||||||
channel := vb.client.Channel
|
channel := vb.client.Channel
|
||||||
|
if channel != nil {
|
||||||
for _, client := range channel.clients {
|
for _, client := range channel.clients {
|
||||||
if client != vb.client {
|
if client != vb.client {
|
||||||
err := client.SendUDP(vb.buf)
|
err := client.SendUDP(vb.buf)
|
||||||
|
|
@ -409,6 +410,7 @@ func (server *Server) handlerLoop() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
target, ok := vb.client.voiceTargets[uint32(vb.target)]
|
target, ok := vb.client.voiceTargets[uint32(vb.target)]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue