Throw IllegalStateException when restarting MiraiConsoleImplementation

This commit is contained in:
Him188 2020-09-17 10:24:48 +08:00
parent cd6e78d36c
commit 466b067d9f

View File

@ -189,6 +189,7 @@ public interface MiraiConsoleImplementation : CoroutineScope {
@ConsoleFrontEndImplementation
@Throws(MalformedMiraiConsoleImplementationError::class)
public fun MiraiConsoleImplementation.start(): Unit = initLock.withLock {
if (::instance.isInitialized) error("Mirai Console is already initialized.")
this@Companion.instance = this
MiraiConsoleImplementationBridge.doStart()
}