From a6d98426e3d26e4371e2c2c0570c88a0b99de52d Mon Sep 17 00:00:00 2001 From: Him188 Date: Thu, 20 Aug 2020 20:11:21 +0800 Subject: [PATCH] Fix #117: owning setting storage is not set after load --- .../mirai/console/internal/setting/SettingStorage internal.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/setting/SettingStorage internal.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/setting/SettingStorage internal.kt index 5987eae66..6b0a9d0d4 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/setting/SettingStorage internal.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/setting/SettingStorage internal.kt @@ -146,7 +146,7 @@ internal open class MultiFileSettingStorageImpl( check(file.exists() && file.isFile && file.canRead()) { "${file.absolutePath} cannot be read" } Yaml.default.decodeFromString(instance.updaterSerializer, file.readText()) instance - } + }.also { it.setStorage(this) } protected open fun getSettingFile(holder: SettingHolder, clazz: KClass<*>): File = with(clazz) { val name = findASerialName()