diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt index 08c819899..41d4b937f 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt @@ -133,7 +133,9 @@ class ContentView : FrameLayout { fun scrollTo(pos: Int?) { if (pos != null) { content_text_view.post { - content_text_view.scrollTo(0, content_text_view.layout.getLineTop(pos)) + if (content_text_view.layout.lineCount >= pos) { + content_text_view.scrollTo(0, content_text_view.layout.getLineTop(pos)) + } } } }