Fix findMiraiInstance

This commit is contained in:
Him188 2020-11-01 23:54:49 +08:00
parent 17eeb56a76
commit 9e6b16c3e5

View File

@ -12,6 +12,6 @@ package net.mamoe.mirai
import java.util.*
internal actual fun findMiraiInstance(): Mirai {
return ServiceLoader.load(Mirai::class.java).findFirst() as Mirai?
return ServiceLoader.load(Mirai::class.java).findFirst().orElse(null)
?: Class.forName("net.mamoe.mirai.internal.MiraiImpl").kotlin.objectInstance as Mirai
}