From b69f1bc35cfbdba08a93c5986b602731203e60de Mon Sep 17 00:00:00 2001 From: "Vladislav.Yaroshchuk" Date: Thu, 9 Mar 2023 18:57:03 +0400 Subject: [PATCH] [configuration-script] Return default values if node is removed This fixes hot reload of intellj.yaml config: when some entry existed and was removed, state returns field's default value instead of value cached before removal. This change affects only internal projects which use intellij.yaml config. GitOrigin-RevId: e9cd64e191ecd86adf46979d81e6eca315aba169 --- .../src/providers/ConfigurationScriptProjectStoreFactory.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/configuration-script/src/providers/ConfigurationScriptProjectStoreFactory.kt b/plugins/configuration-script/src/providers/ConfigurationScriptProjectStoreFactory.kt index 7a58abb7588f..fd6b86331ef0 100644 --- a/plugins/configuration-script/src/providers/ConfigurationScriptProjectStoreFactory.kt +++ b/plugins/configuration-script/src/providers/ConfigurationScriptProjectStoreFactory.kt @@ -108,8 +108,10 @@ private class ReadOnlyStorage(val configurationSchemaKey: String, val componentC } } - val node = configurationFileManager.findValueNode(configurationSchemaKey) ?: return null - readIntoObject(state, node) + val node = configurationFileManager.findValueNode(configurationSchemaKey) + if (node != null) { + readIntoObject(state, node) + } @Suppress("UNCHECKED_CAST") return state as T }