Skip to content

Commit 5a8f05f

Browse files
author
dfdeagle47
committed
Update index.js
Fix to .limit(n): if the next page is not a url (e.g. the link is broken or we reached the last page), the method should return fn(null, pages), and not call fn(null, pages) and continue to the next page.
1 parent b8875ab commit 5a8f05f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function Xray() {
138138
if (!isUrl(url)) {
139139
debug('%j is not a url, finishing up', url);
140140
stream(obj, true);
141-
fn(null, pages);
141+
return fn(null, pages);
142142
}
143143

144144
stream(obj);

0 commit comments

Comments
 (0)