Przeglądaj źródła

fix(CustomDialog): 🐛 修复 错误表达式会导致流程中断

修复后行为为:
+ 丢弃错误表达式
+ 尝试解析剩下的表达式
Discut 3 lat temu
rodzic
commit
21114edbf6

+ 4 - 2
app/src/main/java/io/legado/app/ui/book/cache/CacheViewModel.kt

@@ -270,8 +270,10 @@ class CacheViewModel(application: Application) : BaseViewModel(application) {
             }
             val left = v[0].toInt()
             val right = v[1].toInt()
-            if (left > right)
-                return IntArray(0)
+            if (left > right){
+                AppLog.put("Error expression : $s; left > right")
+                continue
+            }
             for (i in left..right)
                 result.add(i - 1)
         }