Explorar el Código

add null check for search content

heweikang hace 1 año
padre
commit
b84bb72e07
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  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