Horis 1 год назад
Родитель
Сommit
494c9d57b9

+ 1 - 1
app/src/main/java/io/legado/app/data/entities/BaseSource.kt

@@ -116,7 +116,7 @@ interface BaseSource : JsExtensions {
                     putAll(map)
                 }
             } catch (e: Exception) {
-                AppLog.put("getHeaderMap 出错\n$e", e)
+                AppLog.put("执行请求头规则出错\n$e", e)
             }
         }
         if (!has(AppConst.UA_NAME, true)) {

+ 2 - 2
app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt

@@ -191,9 +191,9 @@ abstract class PageDelegate(protected val readView: ReadView) {
     }
 
     fun postInvalidate() {
-        if (isRunning && this is HorizontalPageDelegate) {
+        if (isStarted && isRunning && this is HorizontalPageDelegate) {
             readView.post {
-                if (isRunning) {
+                if (isStarted && isRunning) {
                     setBitmap()
                     readView.invalidate()
                 }

+ 6 - 2
app/src/main/java/io/legado/app/utils/GsonExtensions.kt

@@ -68,7 +68,9 @@ inline fun <reified T> Gson.fromJsonArray(json: String?): Result<List<T>> {
         val type = TypeToken.getParameterized(List::class.java, T::class.java).type
         val list = fromJson(json, type) as List<T?>
         if (list.contains(null)) {
-            throw JsonSyntaxException("存在null")
+            throw JsonSyntaxException(
+                "列表不能存在null元素,可能是json格式错误,通常为列表存在多余的逗号所致"
+            )
         }
         @Suppress("UNCHECKED_CAST")
         list as List<T>
@@ -94,7 +96,9 @@ inline fun <reified T> Gson.fromJsonArray(inputStream: InputStream?): Result<Lis
         val type = TypeToken.getParameterized(List::class.java, T::class.java).type
         val list = fromJson(reader, type) as List<T?>
         if (list.contains(null)) {
-            throw JsonSyntaxException("存在null")
+            throw JsonSyntaxException(
+                "列表不能存在null元素,可能是json格式错误,通常为列表存在多余的逗号所致"
+            )
         }
         @Suppress("UNCHECKED_CAST")
         list as List<T>