瀏覽代碼

Fix settings search crash (fixes #5002)

Can't lateinit since the controllers are instantiated via reflection.
arkon 3 年之前
父節點
當前提交
b453be081e
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt

+ 1 - 2
app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt

@@ -33,11 +33,10 @@ abstract class SettingsController : PreferenceController() {
 
     var preferenceKey: String? = null
     val preferences: PreferencesHelper = Injekt.get()
-    lateinit var viewScope: CoroutineScope
+    val viewScope: CoroutineScope = MainScope()
     private var themedContext: Context? = null
 
     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle?): View {
-        viewScope = MainScope()
         val view = super.onCreateView(inflater, container, savedInstanceState)
 
         if (this is RootController) {