[POR-476] Fix application getting removed from env groups
@@ -536,7 +536,7 @@ export const getMetadata: GetMetadataFunction<KeyValueArrayMetadata> = (
state: KeyValueArrayFieldState
) => {
// We don't need any metadata for other key-value-array fields yet so we return null for that variable
- if (!props?.variable?.includes("env")) {
+ if (!state || !props?.variable?.includes("env")) {
return {
[props.variable]: null,
};