From 517df933671618a7e0cab589fb33908c1a6a8247 Mon Sep 17 00:00:00 2001 From: Andrew Aquino Date: Mon, 6 Jul 2026 16:33:20 -0700 Subject: [PATCH] fix(site/src/pages/TemplateBuilder): allow TemplateCard to be selected if it has no variables (#27031) Fixes a bug where if `base.variables` is not defined, clicking a `TemplateCard` fails (no base template gets selected) and this error gets logged: ``` Uncaught TypeError: Cannot read properties of undefined (reading 'length') ``` image --- site/src/pages/TemplateBuilder/BaseInfraSelectStep.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/pages/TemplateBuilder/BaseInfraSelectStep.tsx b/site/src/pages/TemplateBuilder/BaseInfraSelectStep.tsx index 1128a0ec26..93ddbd6de5 100644 --- a/site/src/pages/TemplateBuilder/BaseInfraSelectStep.tsx +++ b/site/src/pages/TemplateBuilder/BaseInfraSelectStep.tsx @@ -23,7 +23,7 @@ function toSelectedBaseMeta(base: TemplateBuilderBase): SelectedBaseMeta { iconUrl: base.icon, os: base.os, hasParameters: - base.variables.length > 0 && base.variables.some((v) => !v.sensitive), + base.variables?.length > 0 && base.variables?.some((v) => !v.sensitive), hasPrerequisites: Boolean(base.prerequisites?.length), }; }