Skip to content

Commit

Permalink
Don't freeze if a post has an undefined url
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderhenne committed Feb 18, 2018
1 parent 49c8212 commit ab83f55
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions js/index.js
Expand Up @@ -181,9 +181,10 @@ function download(anchor) {
}

var post = children[i].data;
var url = post.url;

/* Only download if there's a URL */
if (post.url === null) {
if (url == null) {
continue;
}

Expand All @@ -200,8 +201,6 @@ function download(anchor) {
}
}

var url = post.url;

/* Continue if direct url is a gif and user doesn't want to download gifs */
if (!includeGifs && (url.indexOf(".gif") !== -1 || url.indexOf(".gifv") !== -1)) {
continue;
Expand Down

0 comments on commit ab83f55

Please sign in to comment.