From: Max Kanat-Alexander Date: Mon, 14 Feb 2011 20:17:04 +0000 (-0800) Subject: Bug 633055: Make Bug.legal_values explicitly throw an error if you pass "undef" X-Git-Tag: bugzilla-4.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3d4a86dc1246c84d6a9e5dea4ab1099b79516fa;p=thirdparty%2Fbugzilla.git Bug 633055: Make Bug.legal_values explicitly throw an error if you pass "undef" for the "field" parameter r=dkl, a=mkanat --- diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index 0b5fe16c21..0c88d217f7 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -572,6 +572,10 @@ sub create { sub legal_values { my ($self, $params) = @_; + + defined $params->{field} + or ThrowCodeError('param_required', { param => 'field' }); + my $field = Bugzilla::Bug::FIELD_MAP->{$params->{field}} || $params->{field};