From 6a76315688b0f19c0237984545484966c10ea5e4 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 16 May 2022 22:21:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/read/BaseReadBookActivity.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/BaseReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/BaseReadBookActivity.kt index 099ee02df..27cdef098 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/BaseReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/BaseReadBookActivity.kt @@ -229,8 +229,12 @@ abstract class BaseReadBookActivity : customView { alertBinding.root } yesButton { alertBinding.run { - val start = editStart.text?.toString()?.toInt() ?: 0 - val end = editEnd.text?.toString()?.toInt() ?: book.totalChapterNum + val start = editStart.text!!.toString().let { + if (it.isEmpty()) 0 else it.toInt() + } + val end = editEnd.text!!.toString().let { + if (it.isEmpty()) book.totalChapterNum else it.toInt() + } CacheBook.start(this@BaseReadBookActivity, book, start - 1, end - 1) } }