1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-09 08:32:48 +00:00

fix nil pointer dereference

This commit is contained in:
2021-02-14 17:42:04 -06:00
parent 4aeeb3ef14
commit 28d6d23b51

View File

@@ -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)