diff --git a/app/src/main/java/io/legado/app/model/rss/RssParserByRule.kt b/app/src/main/java/io/legado/app/model/rss/RssParserByRule.kt index c1609c852..1bd629a50 100644 --- a/app/src/main/java/io/legado/app/model/rss/RssParserByRule.kt +++ b/app/src/main/java/io/legado/app/model/rss/RssParserByRule.kt @@ -23,10 +23,9 @@ object RssParserByRule { ) } - val analyzeRule = AnalyzeRule() - analyzeRule.setContent(xml) - rssSource.ruleArticles?.let { ruleArticles -> + val analyzeRule = AnalyzeRule() + analyzeRule.setContent(xml) val collections = analyzeRule.getElements(ruleArticles) val ruleGuid = analyzeRule.splitSourceRule(rssSource.ruleGuid ?: "") val ruleTitle = analyzeRule.splitSourceRule(rssSource.ruleTitle ?: "") @@ -51,7 +50,9 @@ object RssParserByRule { ruleImage, ruleContent, ruleLink - ) + )?.let { + articleList.add(it) + } } } ?: let { return RssParser.parseXML(xml, rssSource.sourceUrl) @@ -84,6 +85,9 @@ object RssParserByRule { rssArticle.image = analyzeRule.getString(ruleImage) rssArticle.content = analyzeRule.getString(ruleContent) rssArticle.link = analyzeRule.getString(ruleLink) + if (rssArticle.title.isNullOrBlank()) { + return null + } return rssArticle } } \ No newline at end of file