Commit f297bdbc authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 650593: Bugzilla crashes when the database is gone, even when shutdownhtml is set

r=justdave a=LpSolit
parent 0803a268
...@@ -442,9 +442,10 @@ sub _css_link_set { ...@@ -442,9 +442,10 @@ sub _css_link_set {
return \%set; return \%set;
} }
my $user = Bugzilla->user; my $skin_user_prefs = Bugzilla->user->settings->{skin};
my $cgi_path = bz_locations()->{'cgi_path'}; my $cgi_path = bz_locations()->{'cgi_path'};
my $all_skins = $user->settings->{'skin'}->legal_values; # If the DB is not accessible, user settings are not available.
my $all_skins = $skin_user_prefs ? $skin_user_prefs->legal_values : [];
my %skin_urls; my %skin_urls;
foreach my $option (@$all_skins) { foreach my $option (@$all_skins) {
next if $option eq 'standard'; next if $option eq 'standard';
...@@ -456,7 +457,7 @@ sub _css_link_set { ...@@ -456,7 +457,7 @@ sub _css_link_set {
} }
$set{alternate} = \%skin_urls; $set{alternate} = \%skin_urls;
my $skin = $user->settings->{'skin'}->{'value'}; my $skin = $skin_user_prefs->{'value'};
if ($skin ne 'standard' and defined $set{alternate}->{$skin}) { if ($skin ne 'standard' and defined $set{alternate}->{$skin}) {
$set{skin} = delete $set{alternate}->{$skin}; $set{skin} = delete $set{alternate}->{$skin};
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment