From 1c1807df45bec77a9d1d43e80f1b839ade3fb934 Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Sat, 14 Feb 2026 17:30:58 -0800 Subject: [PATCH] defensive checks for null --- .../AccessGroups/AccessGroupsDetailsPage.tsx | 28 +++++++++---------- .../AccessGroups/AccessGroupsPage.tsx | 14 +++++----- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ui/litellm-dashboard/src/components/AccessGroups/AccessGroupsDetailsPage.tsx b/ui/litellm-dashboard/src/components/AccessGroups/AccessGroupsDetailsPage.tsx index 7db2e338cf4..1cfc4ad43d5 100644 --- a/ui/litellm-dashboard/src/components/AccessGroups/AccessGroupsDetailsPage.tsx +++ b/ui/litellm-dashboard/src/components/AccessGroups/AccessGroupsDetailsPage.tsx @@ -105,11 +105,11 @@ export function AccessGroupDetail({ Models - {modelIds.length} + {modelIds?.length} ), children: - modelIds.length > 0 ? ( + modelIds?.length > 0 ? ( MCP Servers - {mcpServerIds.length} + {mcpServerIds?.length} ), children: - mcpServerIds.length > 0 ? ( + mcpServerIds?.length > 0 ? ( Agents - {agentIds.length} + {agentIds?.length} ), children: - agentIds.length > 0 ? ( + agentIds?.length > 0 ? ( Attached Keys - {keyIds.length} + {keyIds?.length} } extra={ - keyIds.length > MAX_PREVIEW ? ( + keyIds?.length > MAX_PREVIEW ? ( ) : null } > - {keyIds.length > 0 ? ( + {keyIds?.length > 0 ? ( {displayedKeys.map((id) => ( @@ -293,23 +293,23 @@ export function AccessGroupDetail({ Attached Teams - {teamIds.length} + {teamIds?.length} } extra={ - teamIds.length > MAX_PREVIEW ? ( + teamIds?.length > MAX_PREVIEW ? ( ) : null } > - {teamIds.length > 0 ? ( + {teamIds?.length > 0 ? ( {displayedTeams.map((id) => ( diff --git a/ui/litellm-dashboard/src/components/AccessGroups/AccessGroupsPage.tsx b/ui/litellm-dashboard/src/components/AccessGroups/AccessGroupsPage.tsx index 8aca22bd369..9e5b9017c05 100644 --- a/ui/litellm-dashboard/src/components/AccessGroups/AccessGroupsPage.tsx +++ b/ui/litellm-dashboard/src/components/AccessGroups/AccessGroupsPage.tsx @@ -204,27 +204,27 @@ export function AccessGroupsPage() { const agentIds = record.agentIds ?? []; return ( - + - {modelIds.length} + {modelIds?.length} - + - {mcpServerIds.length} + {mcpServerIds?.length} - + - {agentIds.length} + {agentIds?.length} @@ -356,7 +356,7 @@ export function AccessGroupsPage() { /> setCurrentPage(page)} size="small"