@@ -203,7 +203,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
203203
204204 // Compute whether auto-approval is paused (user is typing in a followup)
205205 const isFollowUpAutoApprovalPaused = useMemo ( ( ) => {
206- return ! ! ( inputValue && inputValue . trim ( ) . length > 0 && clineAsk === "followup" )
206+ return ! ! ( inputValue && ( inputValue ?? "" ) . trim ( ) . length > 0 && clineAsk === "followup" )
207207 } , [ inputValue , clineAsk ] )
208208
209209 // Cancel auto-approval timeout when user starts typing
@@ -710,7 +710,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
710710
711711 // Handle enqueue button click from textarea
712712 const handleEnqueueCurrentMessage = useCallback ( ( ) => {
713- const text = inputValue . trim ( )
713+ const text = ( inputValue ?? "" ) . trim ( )
714714 if ( text || selectedImages . length > 0 ) {
715715 vscode . postMessage ( {
716716 type : "queueMessage" ,
@@ -1536,12 +1536,12 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
15361536
15371537 useImperativeHandle ( ref , ( ) => ( {
15381538 acceptInput : ( ) => {
1539- const hasInput = inputValue . trim ( ) || selectedImages . length > 0
1539+ const hasInput = ( inputValue ?? "" ) . trim ( ) || selectedImages . length > 0
15401540
15411541 // Special case: during command_output, queue the message instead of
15421542 // triggering the primary button action (which would lose the message)
15431543 if ( clineAskRef . current === "command_output" && hasInput ) {
1544- vscode . postMessage ( { type : "queueMessage" , text : inputValue . trim ( ) , images : selectedImages } )
1544+ vscode . postMessage ( { type : "queueMessage" , text : ( inputValue ?? "" ) . trim ( ) , images : selectedImages } )
15451545 setInputValue ( "" )
15461546 setSelectedImages ( [ ] )
15471547 return
0 commit comments