Skip to content

Commit

Permalink
Parse uuid safely when adding signal quote
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Dec 31, 2023
1 parent 35b1f06 commit 3593b5f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion portal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1069,8 +1069,12 @@ func (portal *Portal) addSignalQuote(ctx context.Context, content *event.Message
if quote == nil {
return
}
quotedSender, err := uuid.Parse(quote.QuotedSender)
if err != nil {
return
}
originalMessage, err := portal.bridge.DB.Message.GetBySignalID(
ctx, uuid.MustParse(quote.QuotedSender), quote.QuotedTimestamp, 0, portal.Receiver,
ctx, quotedSender, quote.QuotedTimestamp, 0, portal.Receiver,
)
if err != nil {
zerolog.Ctx(ctx).Err(err).Str("quoted_sender", quote.QuotedSender).Uint64("quoted_timestamp", quote.QuotedTimestamp).Msg("Failed to get quoted message from database")
Expand Down

0 comments on commit 3593b5f

Please sign in to comment.