From 410d39048d819de758353112f41a0a95a046d999 Mon Sep 17 00:00:00 2001 From: Pedro Sousa <680496+pedrosousa@users.noreply.github.com> Date: Fri, 3 Jan 2025 12:10:54 +0000 Subject: [PATCH] Handle missing response --- bin/crawl-api-links.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/crawl-api-links.js b/bin/crawl-api-links.js index 05ce9ae0bcda30..d06214fb1e9346 100644 --- a/bin/crawl-api-links.js +++ b/bin/crawl-api-links.js @@ -68,8 +68,12 @@ async function checkLinks() { }); visitedLinks.push(pageLink); - if (response.status() === 404) { - brokenLinks.push(pageLink); + if (response) { + if (response.status() === 404) { + brokenLinks.push(pageLink); + } + } else { + console.log("WARNING: Didn't receive a response... skipping."); } } }