From 28d6d23b5108742f89fb355f70181aaf0c96660d Mon Sep 17 00:00:00 2001 From: Mitchell Date: Sun, 14 Feb 2021 17:42:04 -0600 Subject: [PATCH] fix nil pointer dereference --- server/bothandlers/sounds.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/bothandlers/sounds.go b/server/bothandlers/sounds.go index fb57bd8..17bee25 100644 --- a/server/bothandlers/sounds.go +++ b/server/bothandlers/sounds.go @@ -57,7 +57,7 @@ func VoiceStateHandler(s *discordgo.Session, v *discordgo.VoiceStateUpdate) { 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)