diff --git a/haystack/components/writers/document_writer.py b/haystack/components/writers/document_writer.py index a0ed98c3e0..76384d8f59 100644 --- a/haystack/components/writers/document_writer.py +++ b/haystack/components/writers/document_writer.py @@ -109,5 +109,8 @@ def run(self, documents: List[Document], policy: Optional[DuplicatePolicy] = Non if policy is None: policy = self.policy + for document in documents: + document.content = document.content.replace('\x00', '') + documents_written = self.document_store.write_documents(documents=documents, policy=policy) return {"documents_written": documents_written}