From ef797f6ed8df90735b1ce8af28368757c0d9082d Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Mon, 9 Jun 2025 20:08:47 -0400 Subject: [PATCH] Fix possible crash in story send. --- .../database/SentStorySyncManifest.kt | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/SentStorySyncManifest.kt b/app/src/main/java/org/thoughtcrime/securesms/database/SentStorySyncManifest.kt index d4b214586a..159b7816ff 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/SentStorySyncManifest.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/database/SentStorySyncManifest.kt @@ -42,16 +42,19 @@ data class SentStorySyncManifest( fun toRecipientsSet(): Set { val recipients = Recipient.resolvedList(entries.map { it.recipientId }) - return recipients.map { recipient -> - val serviceId = recipient.requireServiceId() - val entry = entries.first { it.recipientId == recipient.id } + return recipients + .filter { it.hasServiceId } + .map { recipient -> + val serviceId = recipient.requireServiceId() + val entry = entries.first { it.recipientId == recipient.id } - SignalServiceStoryMessageRecipient( - SignalServiceAddress(serviceId), - entry.distributionLists.map { it.toString() }, - entry.allowedToReply - ) - }.toSet() + SignalServiceStoryMessageRecipient( + SignalServiceAddress(serviceId), + entry.distributionLists.map { it.toString() }, + entry.allowedToReply + ) + } + .toSet() } fun flattenToRows(distributionIdToMessageIdMap: Map): Set {