Skip to content

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

fix(crawl): don't use sitemap if it's empty

Gergő Móricz7d9f5bf8b1a6
diff --git a/apps/api/src/controllers/crawl.ts b/apps/api/src/controllers/crawl.ts
index 4335334ac..c299dc01b 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();