should validate .pageContent

This commit is contained in:
Ziyi Chen
2023-10-27 19:57:01 -04:00
parent 23d39300cb
commit 7aa2e1516e
@@ -71,7 +71,7 @@ class InMemoryVectorStore_VectorStores implements INode {
const flattenDocs = docs && docs.length ? flatten(docs) : []
const finalDocs = []
for (let i = 0; i < flattenDocs.length; i += 1) {
if (flattenDocs[i] !== undefined) {
if (flattenDocs[i] !== undefined && flattenDocs[i].pageContent !== undefined) {
finalDocs.push(new Document(flattenDocs[i]))
}
}