diff --git a/jam-ui/src/components/client/JKSessionScreen.js b/jam-ui/src/components/client/JKSessionScreen.js index 3922aab84..829a00e53 100644 --- a/jam-ui/src/components/client/JKSessionScreen.js +++ b/jam-ui/src/components/client/JKSessionScreen.js @@ -998,7 +998,9 @@ const JKSessionScreen = () => { // Attach button handlers const handleAttachClick = useCallback(() => { - attachFileInputRef.current?.click(); + if (attachFileInputRef.current) { + attachFileInputRef.current.click(); + } }, []); const handleFileSelect = useCallback((e) => { @@ -1017,9 +1019,11 @@ const JKSessionScreen = () => { } // Show warnings if any (e.g., backend may not fully support this type) - validation.warnings?.forEach(warning => { - console.warn('Attachment warning:', warning); - }); + if (validation.warnings) { + validation.warnings.forEach(warning => { + console.warn('Attachment warning:', warning); + }); + } // Open chat window if not already open dispatch(openModal('chat'));