From ea58399fd8d9ad13597ee250b878f1ab4ffe5869 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Thu, 21 Apr 2011 01:33:37 +0000 Subject: [PATCH] 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/trunk@262203 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/Bugzilla/Template.pm | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index f872751a9b1..bd7c566cbf6 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -7778 \ No newline at end of file +7779 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/Template.pm b/mozilla/webtools/bugzilla/Bugzilla/Template.pm index 4de2e815f14..93c31845693 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Template.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Template.pm @@ -442,9 +442,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'; @@ -456,7 +457,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}; }