Don't crash if link (which could be from archive) is not a 4chan filename.

This commit is contained in:
ccd0 2015-04-13 01:28:11 -07:00
parent 9c795c95b2
commit c1f62d1612

View File

@ -183,7 +183,7 @@ class Post
if (thumb = $ '.fileThumb > [data-md5]', fileEl)
$.extend @file,
thumb: thumb
thumbURL: "#{location.protocol}//i.4cdn.org/#{@board}/#{link.href.match(/(\d+)\./)[1]}s.jpg"
thumbURL: if m = link.href.match(/\d+(?=\.\w+$)/) then "#{location.protocol}//i.4cdn.org/#{@board}/#{m[0]}s.jpg"
MD5: thumb.dataset.md5
isSpoiler: $.hasClass thumb.parentNode, 'imgspoiler'