Fix sms export crash with missing thread recipients.

fork-5.53.8
Cody Henthorne 2022-10-17 09:54:08 -04:00 zatwierdzone przez Greyson Parrelli
rodzic 0daed8f7d7
commit 1006af7d8a
1 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -132,14 +132,16 @@ class SignalSmsExportReader(
}
private fun readExportableMmsMessageFromRecord(record: MessageRecord, exportState: MessageExportState): ExportableMessage {
val threadRecipient: Recipient = SignalDatabase.threads.getRecipientForThreadId(record.threadId)!!
val addresses: Set<String> = if (threadRecipient.isMmsGroup) {
val threadRecipient: Recipient? = SignalDatabase.threads.getRecipientForThreadId(record.threadId)
val addresses: Set<String> = if (threadRecipient?.isMmsGroup == true) {
Recipient
.resolvedList(threadRecipient.participantIds)
.map { r -> r.smsExportAddress() }
.toSet()
} else {
} else if (threadRecipient != null) {
setOf(threadRecipient.smsExportAddress())
} else {
setOf(record.individualRecipient.smsExportAddress())
}
val parts: MutableList<ExportableMessage.Mms.Part> = mutableListOf()