Explorar o código

notifications: fix panic by checking err (#580)

ramrunner 0xff hai 9 meses
pai
achega
a76c8d9ab5
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      internal/notifications/notifications.go

+ 6 - 1
internal/notifications/notifications.go

@@ -46,7 +46,12 @@ func HandleIncomingMessage(state *ningen.State, msg *gateway.MessageCreateEvent,
 
 	notifTitle := msg.Author.DisplayOrTag()
 	if guild != nil {
-		member, _ := state.Member(channel.GuildID, msg.Author.ID)
+		member, err := state.Member(channel.GuildID, msg.Author.ID)
+
+		if err != nil {
+			return err
+		}
+
 		if member.Nick != "" {
 			notifTitle = member.Nick
 		}