Do not check initialized when calling backendAccess

This commit is contained in:
Him188 2021-04-10 14:23:51 +08:00
parent 9c3af046c7
commit 824a72b2e7

View File

@ -239,13 +239,7 @@ public interface MiraiConsoleImplementation : CoroutineScope {
* @throws IllegalStateException 当前端实例不是 `this` 时抛出 * @throws IllegalStateException 当前端实例不是 `this` 时抛出
*/ */
public val backendAccess: BackendAccess public val backendAccess: BackendAccess
get() { get() = backendAccessInstance
if (instanceInitialized) {
if (this === instance)
return backendAccessInstance
}
throw IllegalStateException("Permission denied")
}
public companion object { public companion object {
private val backendAccessInstance = object : BackendAccess { private val backendAccessInstance = object : BackendAccess {