Browse Source

fix: allow envVars to be optional in EnvVarsTable

riona-k 4 months ago
parent
commit
4f6f908dd0
1 changed files with 3 additions and 1 deletions
  1. 3 1
      apps/app/src/client/components/Admin/AdminHome/EnvVarsTable.tsx

+ 3 - 1
apps/app/src/client/components/Admin/AdminHome/EnvVarsTable.tsx

@@ -3,7 +3,7 @@ import React, { type JSX } from 'react';
 import { LoadingSpinner } from '@growi/ui/dist/components';
 import { LoadingSpinner } from '@growi/ui/dist/components';
 
 
 type EnvVarsTableProps = {
 type EnvVarsTableProps = {
-  envVars: Record<string, string | number | boolean>,
+  envVars?: Record<string, string | number | boolean>,
 }
 }
 
 
 export const EnvVarsTable: React.FC<EnvVarsTableProps> = (props: EnvVarsTableProps) => {
 export const EnvVarsTable: React.FC<EnvVarsTableProps> = (props: EnvVarsTableProps) => {
@@ -14,6 +14,8 @@ export const EnvVarsTable: React.FC<EnvVarsTableProps> = (props: EnvVarsTablePro
 
 
   const envVarRows: JSX.Element[] = [];
   const envVarRows: JSX.Element[] = [];
 
 
+  if (!props.envVars) return null;
+
   for (const [key, value] of Object.entries(props.envVars)) {
   for (const [key, value] of Object.entries(props.envVars)) {
     if (value != null) {
     if (value != null) {
       envVarRows.push(
       envVarRows.push(