From 9e6ecbf2ca434f78b679783e47eca71a6687722e Mon Sep 17 00:00:00 2001 From: bushixuanqi <57338301+bushixuanqi@users.noreply.github.com> Date: Mon, 5 Jul 2021 01:07:55 +0800 Subject: [PATCH] Update AnalyzeByJSoup.kt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 查找是否存在索引列表时,当区间与当前数字都空时跳出,避免jsoup选择器被当做索引列表而导致出错。 --- .../java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt index 3bb2e4e33..a182dc7f2 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt @@ -237,7 +237,12 @@ class AnalyzeByJSoup(doc: Any) { else -> { //为保证查找顺序,区间和单个索引都添加到同一集合 - if(curList.isEmpty())indexSet.indexs.add(curInt!!) + if(curList.isEmpty()) { + + if(curInt == null) break //是jsoup选择器而非索引列表,跳出 + + indexSet.indexs.add(curInt) + } else{ //列表最后压入的是区间右端,若列表有两位则最先压入的是间隔