FIX: Handle missing letter avatar
This commit is contained in:
parent
3aa143a52c
commit
03f9564804
|
@ -43,8 +43,13 @@ class UserAvatarsController < ApplicationController
|
|||
params.require(:color)
|
||||
params.require(:version)
|
||||
params.require(:size)
|
||||
|
||||
hijack do
|
||||
proxy_avatar("https://avatars.discourse.org/#{params[:version]}/letter/#{params[:letter]}/#{params[:color]}/#{params[:size]}.png", Time.new('1990-01-01'))
|
||||
begin
|
||||
proxy_avatar("https://avatars.discourse.org/#{params[:version]}/letter/#{params[:letter]}/#{params[:color]}/#{params[:size]}.png", Time.new('1990-01-01'))
|
||||
rescue OpenURI::HTTPError
|
||||
render_blank
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue