Skip to content

Commit 410d390

Browse files
committed
Handle missing response
1 parent 7852688 commit 410d390

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bin/crawl-api-links.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,12 @@ async function checkLinks() {
6868
});
6969
visitedLinks.push(pageLink);
7070

71-
if (response.status() === 404) {
72-
brokenLinks.push(pageLink);
71+
if (response) {
72+
if (response.status() === 404) {
73+
brokenLinks.push(pageLink);
74+
}
75+
} else {
76+
console.log("WARNING: Didn't receive a response... skipping.");
7377
}
7478
}
7579
}

0 commit comments

Comments
 (0)