Fix more validation spots around unknown UUIDs.

This was a legacy path that got missed.
This commit is contained in:
Greyson Parrelli 2023-05-11 17:14:56 -04:00
parent ed1aa74aff
commit 43086f9582

View file

@ -1006,6 +1006,11 @@ public class MessageContentProcessor {
return null;
}
if (reaction.getTargetAuthor().isUnknown()) {
Log.w(TAG, "Invalid author UUID!");
return null;
}
Recipient targetAuthor = Recipient.externalPush(reaction.getTargetAuthor());
MessageRecord targetMessage = SignalDatabase.messages().getMessageFor(reaction.getTargetSentTimestamp(), targetAuthor.getId());
@ -3262,7 +3267,9 @@ public class MessageContentProcessor {
List<Mention> mentions = new ArrayList<>(signalServiceMentions.size());
for (SignalServiceDataMessage.Mention mention : signalServiceMentions) {
mentions.add(new Mention(Recipient.externalPush(mention.getServiceId()).getId(), mention.getStart(), mention.getLength()));
if (!mention.getServiceId().isUnknown()) {
mentions.add(new Mention(Recipient.externalPush(mention.getServiceId()).getId(), mention.getStart(), mention.getLength()));
}
}
return mentions;