mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 10:52:45 +08:00
FIX: Invalid logo in discobot's certificate when SiteSetting.logo_small_url
is blank.
https://meta.discourse.org/t/broken-image-in-discobot-certificate-with-no-logo-small-url/76594/2
This commit is contained in:
parent
ee1b90503c
commit
32171ad286
|
@ -568,6 +568,8 @@ module DiscourseNarrativeBot
|
|||
end
|
||||
|
||||
def logo_group(size, width, height)
|
||||
return unless SiteSetting.logo_small_url.present?
|
||||
|
||||
begin
|
||||
uri = URI(SiteSetting.logo_small_url)
|
||||
|
||||
|
|
|
@ -8,4 +8,17 @@ RSpec.describe DiscourseNarrativeBot::CertificateGenerator do
|
|||
expect { described_class.new(user, "2017-00-10") }.to_not raise_error
|
||||
end
|
||||
end
|
||||
|
||||
describe '#logo_group' do
|
||||
describe 'when SiteSetting.logo_small_url is blank' do
|
||||
before do
|
||||
SiteSetting.logo_small_url = ''
|
||||
end
|
||||
|
||||
it 'should not try to fetch a image' do
|
||||
expect(described_class.new(user, "2017-02-10").send(:logo_group, 1, 1, 1))
|
||||
.to eq(nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user