Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(search): filter docs properly

Gergő Móricz7265ab7c6745
diff --git a/apps/api/src/controllers/search.ts b/apps/api/src/controllers/search.ts
index 63820aba6..8a04a9787 100644
--- a/apps/api/src/controllers/search.ts
+++ b/apps/api/src/controllers/search.ts
@@ -108,7 +108,7 @@ export async function searchHelper(
// make sure doc.content is not empty
const filteredDocs = docs.filter(
- (doc: { content?: string }) => doc.content && doc.content.trim().length > 0
+ (doc: { content?: string }) => doc && doc.content && doc.content.trim().length > 0
);
if (filteredDocs.length === 0) {