From e0cca4d6651014a54d8ccaffc120922f9af1b7ab Mon Sep 17 00:00:00 2001 From: Christian Heusel Date: Tue, 21 Jul 2026 23:50:26 +0200 Subject: [PATCH] fix: guard against undefined data volumes in workspace details view The details drawer crashed for any Workspace with no data volume: The backend omits `podTemplate.volumes.data` from the JSON response (omitempty) in that case, but the frontend called `.map()` on it unguarded. Fall back to an empty array, matching the pattern already used for the home volume. Assisted-by: Claude Sonnet 5 Signed-off-by: Christian Heusel --- .../src/app/pages/Workspaces/WorkspaceResources.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/workspaces/frontend/src/app/pages/Workspaces/WorkspaceResources.tsx b/workspaces/frontend/src/app/pages/Workspaces/WorkspaceResources.tsx index 5201ab637..a0f83f16d 100644 --- a/workspaces/frontend/src/app/pages/Workspaces/WorkspaceResources.tsx +++ b/workspaces/frontend/src/app/pages/Workspaces/WorkspaceResources.tsx @@ -23,7 +23,11 @@ interface WorkspaceResourcesProps { } export const WorkspaceResources: React.FC = ({ workspace }) => { - const workspaceDataVol = workspace.podTemplate.volumes.data; + // The generated type marks `data` as required, but the backend omits it when + // there's no data volume, so it can actually be undefined at runtime. + // TODO: This can be dropped once the frontend client is regenerated. + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + const workspaceDataVol = workspace.podTemplate.volumes.data ?? []; const singleDataVolRenderer = ( data: {