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.
This commit is contained in:
evazion
2020-08-07 08:22:23 -05:00
parent 797d8ed617
commit dd44dce597

View File

@@ -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