From edba56a7116ba0181fbafda2fafb846b186c4ca8 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 11 Feb 2012 21:14:29 +0100 Subject: [PATCH] Prevent error. --- 4chan_x.user.js | 3 ++- script.coffee | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 5e8b9ceb0..cca70fe6f 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1528,8 +1528,9 @@ }; _Class.prototype.dragEnd = function() { + var el; $.removeClass(this, 'drag'); - return $.removeClass($('.over', this.parentNode), 'over'); + if (el = $('.over', this.parentNode)) return $.removeClass(el, 'over'); }; _Class.prototype.rm = function() { diff --git a/script.coffee b/script.coffee index a81c6b325..26e5cc685 100644 --- a/script.coffee +++ b/script.coffee @@ -1143,7 +1143,8 @@ qr = qr.replies.splice newIndex, 0, reply dragEnd: -> $.removeClass @, 'drag' - $.removeClass $('.over', @parentNode), 'over' + if el = $ '.over', @parentNode + $.removeClass el, 'over' rm: -> qr.resetFileInput() $.rm @el