diff --git a/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt b/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt index b943c3873..ff3467a8a 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt @@ -12,9 +12,9 @@ import io.legado.app.model.Debug import io.legado.app.model.analyzeRule.AnalyzeRule import io.legado.app.model.analyzeRule.AnalyzeUrl import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.suspendCancellableCoroutine import kotlin.coroutines.resume import kotlin.coroutines.resumeWithException -import kotlin.coroutines.suspendCoroutine object BookChapterList { @@ -24,7 +24,7 @@ object BookChapterList { body: String?, bookSource: BookSource, baseUrl: String - ): List = suspendCoroutine { block -> + ): List = suspendCancellableCoroutine { block -> try { val chapterList = ArrayList() body ?: throw Exception(