Fix StackOverflowError

This commit is contained in:
Karlatemp 2021-05-20 19:31:10 +08:00 committed by Him188
parent b5f47d5f91
commit 7e94eb66d4

View File

@ -54,8 +54,9 @@ internal class MockBotBuilder(
internal fun MockBot(conf: MockBotBuilder.() -> Unit = {}) =
MockBotBuilder(MockConfiguration.copy()).apply(conf).run {
object : QQAndroidBot(MockAccount, this.conf, debugConf) {
override val components: ComponentStorage =
override val components: ComponentStorage by lazy {
componentsProvider?.invoke(this, this) ?: EMPTY_COMPONENT_STORAGE
}
override fun createNetworkHandler(): NetworkHandler =
nhProvider?.invoke(this, this) ?: super.createNetworkHandler()