mirror of
https://github.com/mamoe/mirai.git
synced 2024-12-31 07:07:01 +08:00
Fix findMiraiInstance
This commit is contained in:
parent
17eeb56a76
commit
9e6b16c3e5
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user