From 6506a887b9270af8b79938d9836b8c0acdd1dfa6 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 23 Dec 2019 20:32:40 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/ui/book/read/page/ContentView.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)) + } } } }