zekroTJA / shinpuru

シンプル - Discord Bot with role selection, moderation, karma ranking, a starboard, code execution, raid alerting, backups, a web interface, twitch notifications and more!
https://shnp.de
MIT License
190 stars 37 forks source link

Crash when voting to starboard #366

Closed zekroTJA closed 2 years ago

zekroTJA commented 2 years ago

Type

Crash

Instance

Main Stable (shinpuru#4878 / shnp.de)

Description

For some reason, sometimes, the Auhtor field of the retrieved message from the cache is nil, which results to a nill pointer access in the starboard listener.

This issue is related to zekrotja/dgrs#5.

Steps to reproduce

  1. Enable starboards
  2. send messages
  3. Add stars to the message
  4. Hope you get the weird edge case where that exact behavior occurs

Attachments

goroutine 1407 [running]:
github.com/zekroTJA/shinpuru/internal/listeners.(*ListenerStarboard).ListenerReactionAdd(0xc0003d82d0, 0x0?, 0xc00302aa80)
       /build/internal/listeners/starboard.go:125 +0xcb2
github.com/bwmarrin/discordgo.messageReactionAddEventHandler.Handle(0x0?, 0x0?, {0xe7ac00?, 0xc00302aa80?})
       /go/pkg/mod/github.com/bwmarrin/discordgo@v0.23.3-0.20220216202327-6015eed9333e/eventhandlers.go:578 +0x38
created by github.com/bwmarrin/discordgo.(*Session).handle
       /go/pkg/mod/github.com/bwmarrin/discordgo@v0.23.3-0.20220216202327-6015eed9333e/event.go:171 +0x16a