Skip to content

Commit

Permalink
Quick fix prevents error for "x is hiring" posts.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyonodi committed Jul 13, 2014
1 parent fc07be9 commit d294d22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hackernews.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ function getCommentURL( linkToPost ) {

// check if next row was found
if( commentRow ) {
commentLink = commentRow.querySelector("a:last-child"), // get the last link in that row
commentURL = commentLink.getAttribute("href"); // get the href attribute of comment link
commentLink = commentRow.querySelector("a:last-child"); // get the last link in that row
if ( commentLink )
commentURL = commentLink.getAttribute("href"); // get the href attribute of comment link

// return comment url
return commentURL;
Expand Down

0 comments on commit d294d22

Please sign in to comment.