Fix nil pointer dereference

This commit is contained in:
rigormorrtiss 2021-07-27 20:19:27 +04:00
parent 0f15ab13c6
commit fe1f0432c3

View file

@ -113,7 +113,7 @@ func onReady(_ *discordgo.Session, ready *discordgo.Ready) {
}
func onMessageCreate(_ *discordgo.Session, message *discordgo.MessageCreate) {
if currentChannel.ID == message.ChannelID {
if currentChannel != nil && currentChannel.ID == message.ChannelID {
util.WriteMessage(messagesTextView, session, message.Message)
}
}