From 8fcc9b6695e9ed035bc37631f436def89b70bedd Mon Sep 17 00:00:00 2001 From: James Pine Date: Sat, 18 Apr 2026 21:04:48 -0700 Subject: [PATCH] fix(app): guard against undefined engine in FloatingGenerateBox preset check form.getValues('engine') returns string | undefined; Set.has() rejects undefined under strict mode. Added a truthy guard before the preset lookup. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/src/components/Generation/FloatingGenerateBox.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/components/Generation/FloatingGenerateBox.tsx b/app/src/components/Generation/FloatingGenerateBox.tsx index d977cc1a..79e6a92a 100644 --- a/app/src/components/Generation/FloatingGenerateBox.tsx +++ b/app/src/components/Generation/FloatingGenerateBox.tsx @@ -146,7 +146,7 @@ export function FloatingGenerateBox({ // Cloned/designed profile with no default — ensure a compatible (non-preset) engine const currentEngine = form.getValues('engine'); const presetEngines = new Set(['kokoro', 'qwen_custom_voice']); - if (presetEngines.has(currentEngine)) { + if (currentEngine && presetEngines.has(currentEngine)) { form.setValue('engine', 'qwen'); } }