From fe1991a68a93785cf9800de91925c843f95f3bdf Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 29 Feb 2012 19:12:52 +0100 Subject: [PATCH] Fix #297. --- 4chan_x.user.js | 6 ++++-- script.coffee | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 9e8de9c1d..1ae3e8393 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -664,8 +664,10 @@ return false; }, dimensions: function(root) { - var span; - if (span = $('.filesize', root)) return span.textContent.match(/\d+x\d+/)[0]; + var match, span; + if ((span = $('.filesize', root)) && (match = span.textContent.match(/\d+x\d+/))) { + return match[0]; + } return false; }, filesize: function(root) { diff --git a/script.coffee b/script.coffee index 4f2056a2d..66c26ab0e 100644 --- a/script.coffee +++ b/script.coffee @@ -574,8 +574,8 @@ filter = return file.title false dimensions: (root) -> - if span = $ '.filesize', root - return span.textContent.match(/\d+x\d+/)[0] + if (span = $ '.filesize', root) and match = span.textContent.match /\d+x\d+/ + return match[0] return false filesize: (root) -> if img = $ 'img[md5]', root