Browse Source

Merge remote-tracking branch 'origin/master'

ryoii 6 năm trước cách đây
mục cha
commit
828f1e6ec0

+ 7 - 5
mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugins/PluginManager.kt

@@ -307,9 +307,11 @@ private val trySetAccessibleMethod: Method? = runCatching {
 }.getOrNull()
 
 private fun Constructor<out PluginBase>.againstPermission() {
-    trySetAccessibleMethod?.let { it.invoke(this, true) }
-        ?: kotlin.runCatching {
-            @Suppress("DEPRECATED")
-            this.isAccessible = true
-        }
+    kotlin.runCatching {
+        trySetAccessibleMethod?.let { it.invoke(this) }
+            ?: kotlin.runCatching {
+                @Suppress("DEPRECATED")
+                this.isAccessible = true
+            }
+    }
 }