Просмотр исходного кода

fix(source.loginUI): filter null when arrays end with comma

see https://github.com/gedoor/legado/discussions/4650
Xwite 1 год назад
Родитель
Сommit
767d7e718f
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      app/src/main/java/io/legado/app/data/entities/BaseSource.kt

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

@@ -67,7 +67,7 @@ interface BaseSource : JsExtensions {
     fun loginUi(): List<RowUi>? {
         return GSON.fromJsonArray<RowUi>(loginUi).onFailure {
             it.printOnDebug()
-        }.getOrNull()
+        }.getOrNull()?.filterNotNull() // filter null, see https://github.com/gedoor/legado/discussions/4650
     }
 
     fun getLoginJs(): String? {
@@ -253,4 +253,4 @@ interface BaseSource : JsExtensions {
     fun getShareScope(): Scriptable? {
         return SharedJsScope.getScope(jsLib)
     }
-}
+}