Skip to content

Commit 8f4f7d4

Browse files
committed
Add condition to DynamicLayout crash preventer.
1 parent ab43e40 commit 8f4f7d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
455455
// https://android-review.googlesource.com/c/platform/frameworks/base/+/634929
456456
val dynamicLayoutCrashPreventer = InputFilter { source, start, end, dest, dstart, dend ->
457457
var temp : CharSequence? = null
458-
if (!bypassCrashPreventerInputFilter) {
458+
if (!bypassCrashPreventerInputFilter && dend < dest.length) {
459459

460460
// if there are any images right after the destination position, hack the text
461461
val spans = dest.getSpans(dend, dend+1, AztecImageSpan::class.java)

0 commit comments

Comments
 (0)