summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 287e054ae..c4300b0b5 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -338,7 +338,11 @@ sub switch_to_main_db {
sub get_fields {
my $class = shift;
my $criteria = shift;
- return @{Bugzilla::Field->match($criteria)};
+ # This function may be called during installation, and Field::match
+ # may fail at that time. so we want to return an empty list in that
+ # case.
+ my $fields = eval { Bugzilla::Field->match($criteria) } || [];
+ return @$fields;
}
sub custom_field_names {