Skip to content

Commit 28fa5ed

Browse files
committed
Fixed crash when inserting images into unordered list.
1 parent 2d2c279 commit 28fa5ed

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecUnorderedListSpan.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ package org.wordpress.aztec.spans
2020
import android.graphics.Canvas
2121
import android.graphics.Paint
2222
import android.graphics.Path
23-
import android.os.Parcel
2423
import android.text.Layout
24+
import android.text.Spanned
2525
import android.text.TextUtils
2626
import org.wordpress.aztec.formatting.BlockFormatter
2727

@@ -75,6 +75,11 @@ class AztecUnorderedListSpan : AztecListSpan {
7575
first: Boolean, l: Layout) {
7676
if (!first) return
7777

78+
val spanStart = (text as Spanned).getSpanStart(this)
79+
val spanEnd = text.getSpanEnd(this)
80+
81+
if (start !in spanStart..spanEnd || end !in spanStart..spanEnd) return
82+
7883
val style = p.style
7984
val oldColor = p.color
8085

0 commit comments

Comments
 (0)