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

r=justdave a=LpSolit


git-svn-id: svn://10.0.0.236/branches/BUGZILLA-4_0-BRANCH@262203 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkanat%bugzilla.org 2011-04-21 01:33:37 +00:00
parent e26ee27fe4
commit 385e674d57
2 changed files with 5 additions and 4 deletions

View File

@ -1 +1 @@
7570
7571

View File

@ -430,9 +430,10 @@ sub _css_link_set {
return \%set;
}
my $user = Bugzilla->user;
my $skin_user_prefs = Bugzilla->user->settings->{skin};
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;
foreach my $option (@$all_skins) {
next if $option eq 'standard';
@ -444,7 +445,7 @@ sub _css_link_set {
}
$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}) {
$set{skin} = delete $set{alternate}->{$skin};
}