From b068b564ab39a8ddaa089b22a762e1fe7b1a5b77 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Sat, 18 Apr 2026 19:47:03 -0400 Subject: [PATCH] Add type-safe guard before LoggingLevel cast in LogControls Validate the Select value against LOG_LEVELS before casting to LoggingLevel, ensuring the compiler isn't silently bypassed. Co-Authored-By: Claude Opus 4.6 (1M context) --- clients/web/src/components/groups/LogControls/LogControls.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clients/web/src/components/groups/LogControls/LogControls.tsx b/clients/web/src/components/groups/LogControls/LogControls.tsx index 7e25f3bb..0fccd395 100644 --- a/clients/web/src/components/groups/LogControls/LogControls.tsx +++ b/clients/web/src/components/groups/LogControls/LogControls.tsx @@ -73,7 +73,9 @@ export function LogControls({ data={LOG_LEVELS.map((level) => ({ value: level, label: level }))} value={currentLevel} onChange={(value) => { - if (value) onSetLevel(value as LoggingLevel); + if (value && LOG_LEVELS.includes(value as LoggingLevel)) { + onSetLevel(value as LoggingLevel); + } }} />