FIX: Load base color scheme when default theme is not set
Followup to c937afc
This commit is contained in:
parent
92b26ecbfb
commit
266c0c50d7
|
@ -97,7 +97,7 @@ class Stylesheet::Manager
|
|||
color_scheme = begin
|
||||
ColorScheme.find(color_scheme_id)
|
||||
rescue
|
||||
Theme.find(SiteSetting.default_theme_id).color_scheme || ColorScheme.base
|
||||
Theme.find_by_id(SiteSetting.default_theme_id)&.color_scheme || ColorScheme.base
|
||||
end
|
||||
|
||||
target = COLOR_SCHEME_STYLESHEET.to_sym
|
||||
|
|
|
@ -171,6 +171,12 @@ describe Stylesheet::Manager do
|
|||
expect(link).not_to eq("")
|
||||
end
|
||||
|
||||
it "does not crash when no default theme is set" do
|
||||
SiteSetting.default_theme_id = -1
|
||||
link = Stylesheet::Manager.color_scheme_stylesheet_link_tag()
|
||||
expect(link).not_to eq("")
|
||||
end
|
||||
|
||||
it "does not crash on missing color scheme" do
|
||||
link = Stylesheet::Manager.color_scheme_stylesheet_link_tag(125)
|
||||
expect(link).not_to eq("")
|
||||
|
|
Loading…
Reference in New Issue