From c8e0bb93ea5ff67ef330563f3fac5f54af4a1ffd Mon Sep 17 00:00:00 2001 From: Gergo Moricz Date: Fri, 30 Aug 2024 20:40:45 +0200 Subject: [PATCH] fix(crawl-status): handle null data when purging rawHtml --- apps/api/src/controllers/v1/crawl-status.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/api/src/controllers/v1/crawl-status.ts b/apps/api/src/controllers/v1/crawl-status.ts index 7b94f07a..845f616c 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 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; + } } } }