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 52cfc7863..c2286d1ab 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 @@ -158,12 +158,11 @@ object BookChapterList { val urlRule = analyzeRule.splitSourceRule(tocRule.chapterUrl ?: "") for (item in elements) { analyzeRule.setContent(item) - val title = analyzeRule.getString(nameRule) - if (title.isNotEmpty()) { - val bookChapter = BookChapter(bookUrl = book.bookUrl) - bookChapter.title = title - bookChapter.url = analyzeRule.getString(urlRule, true) - if (bookChapter.url.isEmpty()) bookChapter.url = baseUrl + val bookChapter = BookChapter(bookUrl = book.bookUrl) + bookChapter.title = analyzeRule.getString(nameRule) + bookChapter.url = analyzeRule.getString(urlRule, true) + if (bookChapter.url.isEmpty()) bookChapter.url = baseUrl + if (bookChapter.title.isNotEmpty()) { chapterList.add(bookChapter) } }