Fix Cannot read properties of undefined (reading 'length') (#1145)

Fix upload failed
This commit is contained in:
Ken Kuang 2024-04-21 03:28:19 +08:00 committed by GitHub
parent c65f890afc
commit a3b7239d05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,7 +22,7 @@ async function asPDF({ fullFilePath = "", filename = "" }) {
doc.metadata?.loc?.pageNumber || "unknown"
} --`
);
if (!doc.pageContent.length) continue;
if (!doc.pageContent || !doc.pageContent.length) continue;
pageContent.push(doc.pageContent);
}