diff --git a/src/components/ChatViewer.tsx b/src/components/ChatViewer.tsx index 11f8424..ebe0740 100644 --- a/src/components/ChatViewer.tsx +++ b/src/components/ChatViewer.tsx @@ -294,7 +294,27 @@ export function ChatViewer({ const { searchEmojis } = useEmojiSearch(); // Get the appropriate adapter for this protocol - const adapter = useMemo(() => getAdapter(protocol), [protocol]); + const adapter = useMemo(() => { + if (!protocol) { + return null; + } + return getAdapter(protocol); + }, [protocol]); + + // Handle missing protocol + if (!protocol || !adapter) { + return ( +
Invalid chat configuration
++ Missing protocol. Please use the chat command with a valid + identifier. +
+