From 7d9f5bf8b1a616fc2dbc51b7e54b4c3b79770bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20M=C3=B3ricz?= Date: Thu, 22 Aug 2024 13:40:55 +0200 Subject: [PATCH] fix(crawl): don't use sitemap if it's empty Fixes FIRECRAWL-SCRAPER-JS-11 --- apps/api/src/controllers/crawl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/controllers/crawl.ts b/apps/api/src/controllers/crawl.ts index 4335334a..c299dc01 100644 --- a/apps/api/src/controllers/crawl.ts +++ b/apps/api/src/controllers/crawl.ts @@ -163,7 +163,7 @@ export async function crawlController(req: Request, res: Response) { ? null : await crawler.tryGetSitemap(); - if (sitemap !== null) { + if (sitemap !== null && sitemap.length > 0) { const jobs = sitemap.map((x) => { const url = x.url; const uuid = uuidv4();