mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Fix potential crash in notification message generation.
This commit is contained in:
committed by
Jeffrey Starke
parent
dd01cd15ca
commit
8df8cdf28d
@@ -178,7 +178,11 @@ sealed class NotificationItem(val threadRecipient: Recipient, protected val reco
|
||||
|
||||
if (spoilerRanges?.isNotEmpty() == true) {
|
||||
for (spoiler in spoilerRanges) {
|
||||
updatedText = updatedText.replaceRange(spoiler.start.coerceAtMost(updatedText.length - 1), (spoiler.start + spoiler.length).coerceAtMost(updatedText.length), "■■■■")
|
||||
updatedText = updatedText.replaceRange(
|
||||
startIndex = spoiler.start.coerceAtMost(updatedText.length - 1).coerceAtLeast(0),
|
||||
endIndex = (spoiler.start + spoiler.length).coerceAtMost(updatedText.length).coerceAtLeast(0),
|
||||
replacement = "■■■■"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user