Skip to content

Commit

Permalink
Handle missing response
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrosousa committed Jan 3, 2025
1 parent 7852688 commit 410d390
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/crawl-api-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}
}
Expand Down

0 comments on commit 410d390

Please sign in to comment.