From 6ce330c1c91cf7096af3a3ca4399cb5a996c0813 Mon Sep 17 00:00:00 2001 From: ChloeYeung <106992258+ChloeYeung@users.noreply.github.com> Date: Sat, 17 Aug 2024 17:52:50 +0800 Subject: [PATCH] Front-End: Disallow invalid user input --- Front-End/src/views/chatgpt/index.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Front-End/src/views/chatgpt/index.jsx b/Front-End/src/views/chatgpt/index.jsx index 451d627..c590b57 100644 --- a/Front-End/src/views/chatgpt/index.jsx +++ b/Front-End/src/views/chatgpt/index.jsx @@ -264,6 +264,9 @@ const ChatGptIndex = () => { // desireAiEngine only be used when data-chaining happens, if input is from input filed, desireAiEngine will he undefined const handleMessageInput = async (inputFromUser, desireAiEngine, hiddenFromUser, inputType, extraConfigPdfTransLanguage, messageChaining) => { + // Stop invalid user input + if(!inputFromUser) return + // Set active before processing setInputHandlingActive(true); setLoadingStage('loading');