diff --git a/.changeset/famous-tomatoes-join.md b/.changeset/famous-tomatoes-join.md new file mode 100644 index 00000000000..d132ee6b10c --- /dev/null +++ b/.changeset/famous-tomatoes-join.md @@ -0,0 +1,5 @@ +--- +"kilo-code": patch +--- + +fix(ui): prevent TypeError when trimming input during model switching (#5614) diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index 86f0afc3f26..06fb9468e2d 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -451,7 +451,7 @@ export const ChatTextArea = forwardRef( }, [selectedType, searchQuery]) const handleEnhancePrompt = useCallback(() => { - const trimmedInput = inputValue.trim() + const trimmedInput = inputValue?.trim() ?? "" if (trimmedInput) { setIsEnhancingPrompt(true)