From e4b65e6dadefe6b7ec8986269f51541feaf08d20 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sun, 22 May 2011 10:01:59 -0700 Subject: [PATCH] fix error when quoted post doesn't exist --- 4chan_x.js | 6 +++++- script.coffee | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) 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'