From: lpsolit%gmail.com <> Date: Thu, 23 Jul 2009 21:33:54 +0000 (+0000) Subject: Bug 504944: Use of uninitialized value in hash element at Bugzilla/Field/Choice.pm... X-Git-Tag: bugzilla-3.5.1~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1d2460f8c48c8f23d1fc2ed876ec65cfd370949;p=thirdparty%2Fbugzilla.git Bug 504944: Use of uninitialized value in hash element at Bugzilla/Field/Choice.pm line 253 - Patch by Frédéric Buclin r/a=mkanat --- diff --git a/Bugzilla/Field/Choice.pm b/Bugzilla/Field/Choice.pm index ce1020d6b8..7e07ca1e2a 100644 --- a/Bugzilla/Field/Choice.pm +++ b/Bugzilla/Field/Choice.pm @@ -250,10 +250,11 @@ sub field { sub is_default { my $self = shift; - my $param_value = - Bugzilla->params->{ $self->DEFAULT_MAP->{$self->field->name} }; - return 0 if !defined $param_value; - return $self->name eq $param_value ? 1 : 0; + my $name = $self->DEFAULT_MAP->{$self->field->name}; + # If it doesn't exist in DEFAULT_MAP, then there is no parameter + # related to this field. + return 0 unless $name; + return ($self->name eq Bugzilla->params->{$name}) ? 1 : 0; } sub is_static {