Skip to content

Commit

Permalink
Merge pull request FlowiseAI#1127 from chz8494/memory_replace_fix
Browse files Browse the repository at this point in the history
[Bug] Fix Cannot read properties of undefined (reading 'replace')
  • Loading branch information
HenryHengZJ authored Oct 29, 2023
2 parents 8d65c90 + cc3c881 commit e745cc2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ class InMemoryVectorStore_VectorStores implements INode {
const flattenDocs = docs && docs.length ? flatten(docs) : []
const finalDocs = []
for (let i = 0; i < flattenDocs.length; i += 1) {
finalDocs.push(new Document(flattenDocs[i]))
if (flattenDocs[i] !== undefined && flattenDocs[i].pageContent !== undefined) {
finalDocs.push(new Document(flattenDocs[i]))
}
}

const vectorStore = await MemoryVectorStore.fromDocuments(finalDocs, embeddings)
Expand Down

0 comments on commit e745cc2

Please sign in to comment.