Fix YukiHookModulePrefs instance context maybe set to null

This commit is contained in:
2022-05-16 23:31:46 +08:00
parent e97e2367d3
commit 2e03a557d6

View File

@@ -77,7 +77,7 @@ class YukiHookModulePrefs(private var context: Context? = null) {
* @return [YukiHookModulePrefs]
*/
internal fun instance(context: Context? = null) =
instance?.apply { this.context = context } ?: YukiHookModulePrefs(context).apply { instance = this }
instance?.apply { if (context != null) this.context = context } ?: YukiHookModulePrefs(context).apply { instance = this }
/**
* 设置全局可读可写