소스 검색

Return null on getMetadata if input hasn't been instantiated

jnfrati 4 년 전
부모
커밋
24784d5353
1개의 변경된 파일과 1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      dashboard/src/components/porter-form/field-components/KeyValueArray.tsx

+ 1 - 1
dashboard/src/components/porter-form/field-components/KeyValueArray.tsx

@@ -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,
     };