From 6db709df6a3241109389e3882cb0c58bc0a3a9f8 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 25 Aug 2019 21:42:23 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt b/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt index 5903f9876..d63c7b526 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt @@ -42,7 +42,7 @@ data class TextChapter( fun getUnRead(pageIndex: Int): String { val stringBuilder = StringBuilder() - if (pageIndex < pages.size) { + if (pageIndex < pages.size && pages.isNotEmpty()) { for (index in pageIndex..lastIndex()) { stringBuilder.append(pages[index].text) }