Browse Source

Merge pull request #1679 from porter-dev/belanger/fix-env-group-settings

Fix crash on expanded env group settings
abelanger5 4 năm trước cách đây
mục cha
commit
6058af84cb

+ 6 - 1
dashboard/src/main/home/cluster-dashboard/env-groups/ExpandedEnvGroup.tsx

@@ -430,7 +430,12 @@ const EnvGroupSettings = ({
   const [isAuthorized] = useAuth();
 
   const canDelete = useMemo(() => {
-    return envGroup?.applications.length === 0;
+    // add a case for when applications is null - in this case this is a deprecated env group version
+    if (!envGroup?.applications) {
+      return true;
+    }
+
+    return envGroup?.applications?.length === 0;
   }, [envGroup]);
 
   return (