소스 검색

Do not check initialized when calling `backendAccess`

Him188 4 년 전
부모
커밋
824a72b2e7
1개의 변경된 파일1개의 추가작업 그리고 7개의 파일을 삭제
  1. 1 7
      backend/mirai-console/src/MiraiConsoleImplementation.kt

+ 1 - 7
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 {