From e47b41a6ef33781adf619e994f981de273a88fb5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Thu, 21 Apr 2011 03:23:40 +0200 Subject: [PATCH] Bug 650593: Bugzilla crashes when the database is gone, even when shutdownhtml is set r=justdave a=LpSolit --- Bugzilla/Template.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 4eaa05d29d..a287b8ac95 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -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}; } -- 2.47.2