Properly return a 404 if an existing package has no screenshot
This commit is contained in:
parent
d7771f1a60
commit
5d856c61e6
1 changed files with 3 additions and 1 deletions
|
|
@ -82,7 +82,9 @@ class PackagesController < ApplicationController
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@screenshot = @package.screenshots.first
|
@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
|
thumbnail404
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue