Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(crawl-status): handle null data when purging rawHtml

Gergo Moriczc8e0bb93ea5f
diff --git a/apps/api/src/controllers/v1/crawl-status.ts b/apps/api/src/controllers/v1/crawl-status.ts
index 7b94f07a0..845f616c9 100644
--- a/apps/api/src/controllers/v1/crawl-status.ts
+++ b/apps/api/src/controllers/v1/crawl-status.ts
@@ -103,7 +103,9 @@ export async function crawlStatusController(req: RequestWithAuth<CrawlStatusPara
if (data.length > 0) {
if (!doneJobs[0].data.pageOptions.includeRawHtml) {
for (let ii = 0; ii < doneJobs.length; ii++) {
- delete data[ii].rawHtml;
+ if (data[ii]) {
+ delete data[ii].rawHtml;
+ }
}
}
}