mirror of
https://github.com/bitwarden/android.git
synced 2025-03-03 04:55:54 +03:00
PM-15976 🍒 prevent app crash for non english language (#4485)
Co-authored-by: Phil Cappelli <150719757+phil-livefront@users.noreply.github.com>
This commit is contained in:
parent
596039ab21
commit
040bf04cbb
1 changed files with 6 additions and 0 deletions
|
@ -199,6 +199,12 @@ fun createClickableAnnotatedString(
|
|||
mainString.lastIndexOf(text, ignoreCase = true)
|
||||
}
|
||||
}
|
||||
|
||||
// Skip adding the link if the text to highlight is not found in the main string.
|
||||
// This can happen if the highlighted text is correctly translated, but the main string
|
||||
// is not yet translated, causing the startIndex to be -1.
|
||||
if (startIndex < 0) continue
|
||||
|
||||
val endIndex = startIndex + highlight.textToHighlight.length
|
||||
val link = LinkAnnotation.Clickable(
|
||||
tag = highlight.textToHighlight,
|
||||
|
|
Loading…
Add table
Reference in a new issue