wordpress-mobile / AztecEditor-Android

A reusable native Android rich text editor component.
Mozilla Public License 2.0
698 stars 115 forks source link

Crash report 7.8: IllegalArgumentException, invalid offset in EndOfParagraphMarkerAdder.onTextChanged #458

Open tonyr59h opened 7 years ago

tonyr59h commented 7 years ago

Note: All crashes thus far have been on 7.0 Samsung devices.

Fatal Exception: java.lang.IllegalArgumentException: Invalid offset: 46. Valid range is [0, 45]
       at android.text.method.WordIterator.checkOffsetIsValid(WordIterator.java:380)
       at android.text.method.WordIterator.isBoundary(WordIterator.java:101)
       at android.widget.Editor$SelectionHandleView.positionAtCursorOffset(Editor.java:5860)
       at android.widget.Editor$HandleView.updatePosition(Editor.java:4888)
       at android.widget.Editor$HandleView.updateDrawable(Editor.java:4672)
       at android.widget.Editor$SelectionHandleView.updateSelection(Editor.java:5752)
       at android.widget.Editor$HandleView.positionAtCursorOffset(Editor.java:4855)
       at android.widget.Editor$SelectionHandleView.positionAtCursorOffset(Editor.java:5859)
       at android.widget.Editor$HandleView.invalidate(Editor.java:4735)
       at android.widget.Editor$SelectionModifierCursorController.invalidateHandles(Editor.java:6828)
       at android.widget.Editor.invalidateHandlesAndActionMode(Editor.java:1989)
       at android.widget.TextView.spanChange(TextView.java:9595)
       at android.widget.TextView$ChangeWatcher.onSpanAdded(TextView.java:12363)
       at android.text.SpannableStringBuilder.sendSpanAdded(SpannableStringBuilder.java:1228)
       at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:767)
       at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:677)
       at org.wordpress.aztec.watchers.EndOfParagraphMarkerAdder.onTextChanged(EndOfParagraphMarkerAdder.kt:34)
       at android.widget.TextView.sendOnTextChanged(TextView.java:9412)
       at android.widget.TextView.handleTextChanged(TextView.java:9489)
       at android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:12336)
       at android.text.SpannableStringBuilder.sendTextChanged(SpannableStringBuilder.java:1208)
maxme commented 6 years ago

It's still happening in 8.8 - only on Samsung 7.0 (and pretty rare, 8 reports only)

https://fabric.io/automattic/android/apps/org.wordpress.android/issues/5a1c495861b02d480d62ab8d?time=last-thirty-days