Filter out unmappable body ranges during archive export.

This commit is contained in:
Greyson Parrelli
2026-03-03 09:56:08 -05:00
parent ba720efe61
commit b0eed4a095

View File

@@ -1393,16 +1393,16 @@ private fun ByteArray.toRemoteBodyRanges(dateSent: Long): List<BackupBodyRange>
return emptyList()
}
return decoded.ranges.map { range ->
return decoded.ranges.mapNotNull { range ->
val mention = range.mentionUuid?.let { UuidUtil.parseOrNull(it) }?.toByteArray()?.toByteString()?.takeIf { it.isNotEmpty() }
val style = if (mention == null) {
range.style?.toRemote() ?: BackupBodyRange.Style.NONE
range.style?.toRemote()
} else {
null
}
if (mention == null && style == null) {
return emptyList()
return@mapNotNull null
}
BackupBodyRange(