From 164ca7d47e24498f4998fc02b579e19e32035270 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Thu, 23 Jul 2009 21:35:59 +0000 Subject: [PATCH] =?utf8?q?Bug=20504944:=20Use=20of=20uninitialized=20value?= =?utf8?q?=20in=20hash=20element=20at=20Bugzilla/Field/Choice.pm=20line=20?= =?utf8?q?253=20-=20Patch=20by=20Fr=C3=83=C2=A9d=C3=83=C2=A9ric=20Buclin?= =?utf8?q?=20=20r/a=3Dmkanat?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Bugzilla/Field/Choice.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Bugzilla/Field/Choice.pm b/Bugzilla/Field/Choice.pm index f23b0c46d4..cfb911712e 100644 --- a/Bugzilla/Field/Choice.pm +++ b/Bugzilla/Field/Choice.pm @@ -245,10 +245,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 { -- 2.47.3