Fix a crash when discord doesn't send an author

This commit is contained in:
Gary Kramlich
2022-02-11 03:56:52 -06:00
parent c2e1c35dca
commit 210fdda2fc

View File

@@ -304,7 +304,7 @@ func (p *Portal) markMessageHandled(msg *database.Message, discordID string, mxi
}
func (p *Portal) handleDiscordMessageCreate(user *User, msg *discordgo.Message) {
if user.ID == msg.Author.ID {
if msg.Author != nil && user.ID == msg.Author.ID {
return
}
@@ -340,7 +340,7 @@ func (p *Portal) handleDiscordMessageCreate(user *User, msg *discordgo.Message)
}
func (p *Portal) handleDiscordMessagesUpdate(user *User, msg *discordgo.Message) {
if user.ID == msg.Author.ID {
if msg.Author != nil && user.ID == msg.Author.ID {
return
}