diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index 33660ec3f..cbd881282 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -83,7 +83,7 @@ Gallery = $.on window, 'resize', Gallery.cb.setHeight for postThumb in $$ Site.selectors.file.thumb - post = Get.postFromNode postThumb + continue unless (post = Get.postFromNode postThumb) continue unless post.file?.thumb Gallery.generateThumb post # If no image to open is given, pick image we have scrolled to.