kunfei 3 лет назад
Родитель
Сommit
abeee8acf9
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      app/src/main/java/io/legado/app/data/entities/BaseSource.kt

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

@@ -236,7 +236,9 @@ interface BaseSource : JsExtensions {
         bindings["cookie"] = CookieStore
         bindings["cache"] = CacheManager
         val scope = SCRIPT_ENGINE.getRuntimeScope(SCRIPT_ENGINE.getScriptContext(bindings))
-        scope.prototype = getShareScope()
+        getShareScope()?.let {
+            scope.prototype = it
+        }
         return SCRIPT_ENGINE.eval(jsStr, scope)
     }