From 824a72b2e743a2b3b5efb9d02581e15bce9559dd Mon Sep 17 00:00:00 2001 From: Him188 Date: Sat, 10 Apr 2021 14:23:51 +0800 Subject: [PATCH] Do not check initialized when calling `backendAccess` --- backend/mirai-console/src/MiraiConsoleImplementation.kt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/backend/mirai-console/src/MiraiConsoleImplementation.kt b/backend/mirai-console/src/MiraiConsoleImplementation.kt index 7a2417b56..34b3fb3b0 100644 --- a/backend/mirai-console/src/MiraiConsoleImplementation.kt +++ b/backend/mirai-console/src/MiraiConsoleImplementation.kt @@ -239,13 +239,7 @@ public interface MiraiConsoleImplementation : CoroutineScope { * @throws IllegalStateException 当前端实例不是 `this` 时抛出 */ public val backendAccess: BackendAccess - get() { - if (instanceInitialized) { - if (this === instance) - return backendAccessInstance - } - throw IllegalStateException("Permission denied") - } + get() = backendAccessInstance public companion object { private val backendAccessInstance = object : BackendAccess {