diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2013-01-10 23:05:34 +0100 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2013-01-10 23:05:34 +0100 |
commit | 32a2d5fb62b8756297fc2be7d41599fe24bf7878 (patch) | |
tree | a0ceb47de9e0c67adf827c92070d142124e9f5ee /Bugzilla | |
parent | f7ff15c60c61f2691acaf2d9b8840b85545aa68a (diff) | |
download | bugzilla-32a2d5fb62b8756297fc2be7d41599fe24bf7878.tar.gz bugzilla-32a2d5fb62b8756297fc2be7d41599fe24bf7878.tar.xz |
Bug 829273 - Certain webservice tests failing due to improper error being thrown for undef or empty bug id values
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/Bug.pm | 4 | ||||
-rw-r--r-- | Bugzilla/WebService/Bug.pm | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 779ba59ab..81cb55a43 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -334,8 +334,8 @@ sub new { # If we get something that looks like a word (not a number), # make it the "name" param. if (!defined $param - || (!ref($param) && $param =~ /\D/) - || (ref($param) && $param->{id} =~ /\D/)) + || (!ref($param) && (!$param || $param =~ /\D/)) + || (ref($param) && (!$param->{id} || $param->{id} =~ /\D/))) { # But only if aliases are enabled. if (Bugzilla->params->{'usebugaliases'} && $param) { diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index c0615b169..b6cfe897b 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -325,7 +325,8 @@ sub get { Bugzilla->switch_to_shadow_db(); my $ids = $params->{ids}; - defined $ids || ThrowCodeError('param_required', { param => 'ids' }); + (defined $ids && scalar @$ids) + || ThrowCodeError('param_required', { param => 'ids' }); my @bugs; my @faults; |