mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-25 23:50:15 +08:00
Throw IllegalStateException when restarting MiraiConsoleImplementation
This commit is contained in:
parent
cd6e78d36c
commit
466b067d9f
@ -189,6 +189,7 @@ public interface MiraiConsoleImplementation : CoroutineScope {
|
|||||||
@ConsoleFrontEndImplementation
|
@ConsoleFrontEndImplementation
|
||||||
@Throws(MalformedMiraiConsoleImplementationError::class)
|
@Throws(MalformedMiraiConsoleImplementationError::class)
|
||||||
public fun MiraiConsoleImplementation.start(): Unit = initLock.withLock {
|
public fun MiraiConsoleImplementation.start(): Unit = initLock.withLock {
|
||||||
|
if (::instance.isInitialized) error("Mirai Console is already initialized.")
|
||||||
this@Companion.instance = this
|
this@Companion.instance = this
|
||||||
MiraiConsoleImplementationBridge.doStart()
|
MiraiConsoleImplementationBridge.doStart()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user