From: Max Kanat-Alexander Date: Mon, 14 Feb 2011 20:16:24 +0000 (-0800) Subject: Bug 633055: Make Bug.legal_values explicitly throw an error if you pass "undef" X-Git-Tag: bugzilla-4.1.1~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff3ae632c32d6d004de167b572e34e4f9a3542e1;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 124dd6b258..86c6ef5dad 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -569,6 +569,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};