Properly return a 404 if an existing package has no screenshot

This commit is contained in:
Christoph Haas 2016-06-16 10:42:04 +02:00
parent d7771f1a60
commit 5d856c61e6

View file

@ -82,7 +82,9 @@ class PackagesController < ApplicationController
return
end
@screenshot = @package.screenshots.first
unless @screenshot.image.path
# Return a 404 if the package has no screenshots or the image was not found
unless @screenshot or @screenshot.image.path
thumbnail404
return
end