diff --git a/4chan_x.coffee b/4chan_x.coffee index 18800132b..3bc1d41f8 100644 --- a/4chan_x.coffee +++ b/4chan_x.coffee @@ -688,8 +688,10 @@ replyNav = -> window.location = "##{op}" -#error out if there's no #navtopr. -text = $('#navtopr a').nextSibling +#graceful exit +unless navtopr = $ '#navtopr a' + return +text = navtopr.nextSibling a = tag('a') a.textContent = 'X' a.className = 'pointer' diff --git a/4chan_x.js b/4chan_x.js index fa0fee6e9..4d64358e5 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1,5 +1,5 @@ (function() { - var $, $$, BOARD, DAY, PAGENUM, REPLY, _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, a, arr, as, autoWatch, b, board, callback, callbacks, clearHidden, close, config, cutoff, delform, down, el, expandComment, expandThread, favEmpty, favNormal, favicon, getTime, getValue, head, hiddenReplies, hiddenThreads, hide, hideReply, hideThread, html, i, i1, id, iframe, iframeLoad, iframeLoop, img, inAfter, inBefore, input, inputs, l, l1, lastChecked, magic, minimize, mousedown, mousemove, mouseup, move, n, nodeInserted, nop, now, omitted, onloadComment, onloadThread, options, optionsSave, parseResponse, position, quickReply, r, remove, replace, replyNav, report, show, showReply, showThread, slice, span, stopPropagation, submit, tag, text, thread, threadF, threads, up, watch, watchX, watched, watcher, watcherUpdate, x, xhrs; + var $, $$, BOARD, DAY, PAGENUM, REPLY, _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, a, arr, as, autoWatch, b, board, callback, callbacks, clearHidden, close, config, cutoff, delform, down, el, expandComment, expandThread, favEmpty, favNormal, favicon, getTime, getValue, head, hiddenReplies, hiddenThreads, hide, hideReply, hideThread, html, i, i1, id, iframe, iframeLoad, iframeLoop, img, inAfter, inBefore, input, inputs, l, l1, lastChecked, magic, minimize, mousedown, mousemove, mouseup, move, n, navtopr, nodeInserted, nop, now, omitted, onloadComment, onloadThread, options, optionsSave, parseResponse, position, quickReply, r, remove, replace, replyNav, report, show, showReply, showThread, slice, span, stopPropagation, submit, tag, text, thread, threadF, threads, up, watch, watchX, watched, watcher, watcherUpdate, x, xhrs; var __hasProp = Object.prototype.hasOwnProperty; config = { 'Thread Hiding': true, @@ -754,7 +754,10 @@ return (window.location = ("#" + (op))); } }; - text = $('#navtopr a').nextSibling; + if (!(navtopr = $('#navtopr a'))) { + return null; + } + text = navtopr.nextSibling; a = tag('a'); a.textContent = 'X'; a.className = 'pointer';