Return thumbnail or screenshot image upon 404 instead of exception
This commit is contained in:
parent
a01d2c751c
commit
6a92292e9b
1 changed files with 2 additions and 2 deletions
|
|
@ -106,7 +106,7 @@ class PackagesController < ApplicationController
|
|||
# If the package is found but has no screenshots then it also returns a
|
||||
# dummy image along with status 404.
|
||||
def thumbnail
|
||||
@package = Package.find_by!(name: params[:name])
|
||||
@package = Package.find_by(name: params[:name])
|
||||
unless @package
|
||||
thumbnail404
|
||||
return
|
||||
|
|
@ -135,7 +135,7 @@ class PackagesController < ApplicationController
|
|||
# If the package is found but has no screenshots then it also returns a
|
||||
# dummy image along with status 404.
|
||||
def screenshot
|
||||
@package = Package.find_by!(name: params[:name])
|
||||
@package = Package.find_by(name: params[:name])
|
||||
unless @package
|
||||
screenshot404
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue