diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt index 9f3b17088..74d4734b9 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt @@ -343,8 +343,10 @@ object ChapterProvider { } x = x1 } - val words1 = words.copyOfRange(bodyIndent.length, words.size) - addCharsToLineMiddle(textLine, words1, textPaint, desiredWidth, x, srcList) + if (words.size > bodyIndent.length) { + val words1 = words.copyOfRange(bodyIndent.length, words.size) + addCharsToLineMiddle(textLine, words1, textPaint, desiredWidth, x, srcList) + } } /**