浏览代码

add null check for search content

heweikang 1 年之前
父节点
当前提交
b84bb72e07
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      app/components/search-chat.tsx

+ 1 - 0
app/components/search-chat.tsx

@@ -36,6 +36,7 @@ export function SearchChatPage() {
 
       session.messages.forEach((message) => {
         const content = message.content as string;
+        if (!content.toLowerCase || content === "") return;
         const lowerCaseContent = content.toLowerCase();
 
         // full text search