mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-18 13:42:23 +08:00
Fix findMiraiInstance
This commit is contained in:
parent
17eeb56a76
commit
9e6b16c3e5
@ -12,6 +12,6 @@ package net.mamoe.mirai
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
internal actual fun findMiraiInstance(): Mirai {
|
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
|
?: Class.forName("net.mamoe.mirai.internal.MiraiImpl").kotlin.objectInstance as Mirai
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user