Skip to content

Commit

Permalink
Check truthy-ness of comments
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-h committed Jun 18, 2018
1 parent 5ee7d2c commit d348edb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hn-enhance.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
var articleLink = story.querySelector("td.title > a").href;
var comments = linkRow.querySelector("td > a[href^=item\\?id\\=]");

if (typeof comments !== "undefined") {
// Only add a comments link if we actually have comments on this post
if (comments) {
// Append the "Link + Comments" href after the existing links
// subtext for the story
linkRow.querySelector(".subtext")
Expand Down

0 comments on commit d348edb

Please sign in to comment.