diff --git a/4chan_x.js b/4chan_x.js index 914287c00..469c0145a 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1843,7 +1843,11 @@ return _results; }, mouseout: function() { - return $.removeClass(d.getElementById(this.hash.slice(1)), 'qphl'); + var el; + if (!(el = d.getElementById(this.hash.slice(1)))) { + return; + } + return $.removeClass(el, 'qphl'); }, mouseover: function(e) { var el, id, qp, quote, replyID, req, threadID, _i, _len, _ref; diff --git a/script.coffee b/script.coffee index 2c9e5603b..1a71eb5ef 100644 --- a/script.coffee +++ b/script.coffee @@ -1465,7 +1465,8 @@ quotePreview = $.bind quote, 'mouseout', ui.hoverend $.bind quote, 'mouseout', quotePreview.mouseout mouseout: -> - $.removeClass d.getElementById(@hash[1..]), 'qphl' + return unless el = d.getElementById @hash[1..] + $.removeClass el, 'qphl' mouseover: (e) -> return unless id = @hash[1..] qp = $ '#qp'