Skip to content

Commit

Permalink
Avoid nil dereference on existing reaction lookup (mautrix#433)
Browse files Browse the repository at this point in the history
Otherwise, the bridge crashes when it sees a reaction from Signal.

---

This fixes a crash introduced by 666ccf1.
  • Loading branch information
AndrewFerr authored Jan 26, 2024
1 parent ee5932b commit f5468a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion portal.go
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ func (portal *Portal) handleSignalReaction(sender *Puppet, react *signalpb.DataM
if err != nil {
log.Err(err).Msg("Failed to get existing reaction from database")
return
} else if existingReaction.Emoji == react.GetEmoji() {
} else if existingReaction != nil && existingReaction.Emoji == react.GetEmoji() {
log.Debug().Msg("Ignoring duplicate reaction")
return
}
Expand Down

0 comments on commit f5468a6

Please sign in to comment.