adayoung / ada-bot

Discord bot for Achaea!
MIT License
8 stars 7 forks source link

nil pointer dereference on discordgo.MessageDelete event #25

Closed adayoung closed 7 years ago

adayoung commented 7 years ago

Sep 28 02:43:25 ada-bot[6190]: panic: runtime error: invalid memory address or nil pointer dereference Sep 28 02:43:25 ada-bot[6190]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x73004f] Sep 28 02:43:25 ada-bot[6190]: goroutine 406631 [running]: Sep 28 02:43:25 ada-bot[6190]: github.com/adayoung/ada-bot/discord._botReactions(0xc420083200, 0xc4200fc540, 0x7fc927, 0x6) Sep 28 02:43:25 ada-bot[6190]: /go/src/github.com/adayoung/ada-bot/discord/discord.go:118 +0x49f Sep 28 02:43:25 ada-bot[6190]: created by github.com/adayoung/ada-bot/discord.messageDelete Sep 28 02:43:25 ada-bot[6190]: /go/src/github.com/adayoung/ada-bot/discord/discord.go:100 +0x61 Sep 28 02:43:25 systemd[1]: ada-bot.service: main process exited, code=exited, status=2/INVALIDARGUMENT Sep 28 02:43:25 systemd[1]: Unit ada-bot.service entered failed state. Sep 28 02:43:25 systemd[1]: ada-bot.service failed. Sep 28 02:43:25 systemd[1]: ada-bot.service holdoff time over, scheduling restart. Sep 28 02:43:25 systemd[1]: Started ada-bot discord bot service. Sep 28 02:43:25 systemd[1]: Starting ada-bot discord bot service... Sep 28 02:43:26 ada-bot[17991]: Successfully launched a new Discord session. Sep 28 02:43:26 ada-bot[17991]: Bot is now running. Press CTRL-C to exit.

The bot flails and panics and dies when somebody deletes a direct message :frowning: