Don't exceed text length
This commit is contained in:
parent
b85d7d1658
commit
08bf51fd2a
@ -174,7 +174,7 @@ public class TextHighlighter implements TextProcessor<TextProcessorEditorResult,
|
||||
}
|
||||
|
||||
private int highlightGroup(SpannableStringBuilder sb, int start, int group, int groupsCount, @Nonnull List<GroupSpan> spans) {
|
||||
final int end = fillGroupSpans(sb, start + 1, group, groupsCount, spans);
|
||||
final int end = Math.min(sb.length(), fillGroupSpans(sb, start + 1, group, groupsCount, spans));
|
||||
if (start + 1 < end) {
|
||||
spans.add(new GroupSpan(start + 1, end, group));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user