diff --git a/app/src/main/java/io/legado/app/model/Debug.kt b/app/src/main/java/io/legado/app/model/Debug.kt index 9be322adc..8cab89c29 100644 --- a/app/src/main/java/io/legado/app/model/Debug.kt +++ b/app/src/main/java/io/legado/app/model/Debug.kt @@ -2,6 +2,7 @@ package io.legado.app.model import android.annotation.SuppressLint import io.legado.app.constant.AppPattern +import io.legado.app.constant.BookType import io.legado.app.data.entities.* import io.legado.app.help.coroutine.CompositeCoroutine import io.legado.app.model.rss.Rss @@ -238,7 +239,11 @@ object Debug { .onSuccess { log(debugSource, "︽详情页解析完成") log(debugSource, showTime = false) - tocDebug(scope, bookSource, book) + if (book.type != BookType.file) { + tocDebug(scope, bookSource, book) + } else { + log(debugSource, "≡文件类书源跳过解析目录", state = 1000) + } } .onError { log(debugSource, it.msg, state = -1) diff --git a/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt b/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt index 53847ea52..9595b1079 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt @@ -152,10 +152,15 @@ object BookInfo { scope.ensureActive() Debug.log(bookSource.bookSourceUrl, "┌获取文件下载链接") book.downloadUrls = analyzeRule.getStringList(infoRule.downloadUrls, isUrl = true) - Debug.log( - bookSource.bookSourceUrl, - "└" + TextUtils.join(",\n", book.downloadUrls!!) - ) + if (book.downloadUrls == null) { + Debug.log(bookSource.bookSourceUrl, "└") + throw NoStackTraceException("下载链接为空") + } else { + Debug.log( + bookSource.bookSourceUrl, + "└" + TextUtils.join(",\n", book.downloadUrls!!) + ) + } } }