Skip to content

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

fix(queue-worker): fix linksOnPage undefined error

Gergő Móricz6bd52e63bfe3
diff --git a/apps/api/src/services/queue-worker.ts b/apps/api/src/services/queue-worker.ts
index dedb6ac8b..de53b495f 100644
--- a/apps/api/src/services/queue-worker.ts
+++ b/apps/api/src/services/queue-worker.ts
@@ -174,7 +174,7 @@ async function processJob(job: Job, token: string) {
if (!sc.cancelled) {
const crawler = crawlToCrawler(job.data.crawl_id, sc);
- const links = crawler.filterLinks((data.docs[0].linksOnPage as string[])
+ const links = crawler.filterLinks((data.docs[0].linksOnPage ?? [])
.map(href => crawler.filterURL(href.trim(), sc.originUrl))
.filter(x => x !== null),
Infinity,