mirror of
https://github.com/mgerb/go-discord-bot
synced 2026-01-09 16:42:48 +00:00
fix nil pointer dereference
This commit is contained in:
@@ -57,7 +57,7 @@ func VoiceStateHandler(s *discordgo.Session, v *discordgo.VoiceStateUpdate) {
|
|||||||
|
|
||||||
voiceConnection := conn.getVoiceConnection()
|
voiceConnection := conn.getVoiceConnection()
|
||||||
|
|
||||||
if voiceConnection.Ready && voiceConnection.ChannelID == v.VoiceState.ChannelID {
|
if voiceConnection != nil && voiceConnection.Ready && voiceConnection.ChannelID == v.VoiceState.ChannelID {
|
||||||
|
|
||||||
user, err := model.UserGet(db.GetConn(), v.VoiceState.UserID)
|
user, err := model.UserGet(db.GetConn(), v.VoiceState.UserID)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user