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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user