Skip to content

Commit 4f1a2b9

Browse files
authored
Merge pull request #895 from wordpress-mobile/issue/invalid-span-bounds
Add a condition that prevents invalid span bounds
2 parents ed67593 + fbab659 commit 4f1a2b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/formatting/InlineFormatter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class InlineFormatter(editor: AztecText, val codeStyle: CodeStyle) : AztecFormat
177177
}
178178

179179
private fun applySpan(span: IAztecInlineSpan, start: Int, end: Int, type: Int) {
180-
if (start > end) {
180+
if (start > end || start < 0 || end > editableText.length) {
181181
// If an external logger is available log the error there.
182182
val extLogger = editor.externalLogger
183183
if (extLogger != null) {

0 commit comments

Comments
 (0)