diff --git a/web/screens/Thread/ThreadCenterPanel/EditChatInput/index.tsx b/web/screens/Thread/ThreadCenterPanel/EditChatInput/index.tsx index 5bdaf24520..9b81ea6518 100644 --- a/web/screens/Thread/ThreadCenterPanel/EditChatInput/index.tsx +++ b/web/screens/Thread/ThreadCenterPanel/EditChatInput/index.tsx @@ -72,7 +72,8 @@ const EditChatInput: React.FC = ({ message }) => { }, [editPrompt]) useEffect(() => { - setEditPrompt(message.content[0]?.text?.value) + if (message.content?.[0]?.text?.value) + setEditPrompt(message.content[0].text.value) // eslint-disable-next-line react-hooks/exhaustive-deps }, [])