mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 05:31:14 +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:
@ -568,6 +568,8 @@ module DiscourseNarrativeBot
|
|||||||
end
|
end
|
||||||
|
|
||||||
def logo_group(size, width, height)
|
def logo_group(size, width, height)
|
||||||
|
return unless SiteSetting.logo_small_url.present?
|
||||||
|
|
||||||
begin
|
begin
|
||||||
uri = URI(SiteSetting.logo_small_url)
|
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
|
expect { described_class.new(user, "2017-00-10") }.to_not raise_error
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
Reference in New Issue
Block a user