[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
This commit is contained in:
Vladislav.Yaroshchuk
2023-03-09 17:03:59 +00:00
committed by intellij-monorepo-bot
parent 1fccb04ea8
commit b69f1bc35c
@@ -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
}