diff --git a/apps/api/src/controllers/v1/types.ts b/apps/api/src/controllers/v1/types.ts index 20f1b775..12d1c501 100644 --- a/apps/api/src/controllers/v1/types.ts +++ b/apps/api/src/controllers/v1/types.ts @@ -292,6 +292,8 @@ export function legacyScrapeOptions(x: ScrapeOptions): PageOptions { } export function legacyDocumentConverter(doc: any): Document { + if (doc === null || doc === undefined) return doc; + if (doc.metadata) { if (doc.metadata.screenshot) { doc.screenshot = doc.metadata.screenshot;