From dd44dce5970eda21ae338855bcbba81868ffae56 Mon Sep 17 00:00:00 2001 From: evazion Date: Fri, 7 Aug 2020 08:22:23 -0500 Subject: [PATCH] posts: fix exception when viewing invalid .zip file. Fix exception when viewing post #23077 (a .zip that is not a ugoira). Caused by including large_image_width in the image's data-* attributes. The image_width was nil, which caused a comparison to fail. --- app/models/post.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/post.rb b/app/models/post.rb index a826a71ff..4db165be3 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -239,9 +239,9 @@ class Post < ApplicationRecord def large_image_width if has_large? - [Danbooru.config.large_image_width, image_width].min + [Danbooru.config.large_image_width, image_width.to_i].min else - image_width + image_width.to_i end end