Commit 9e8c5571 authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 1085182: Bugzilla::Bug->check must check that a bug ID is defined when it gets a hashref

r=dkl a=glob
parent 6fde3caa
......@@ -354,14 +354,16 @@ sub new {
sub check {
my $class = shift;
my ($id, $field) = @_;
ThrowUserError('improper_bug_id_field_value', { field => $field }) unless defined $id;
my ($param, $field) = @_;
# Bugzilla::Bug throws lots of special errors, so we don't call
# SUPER::check, we just call our new and do our own checks.
$id = trim($id);
my $self = $class->new($id);
my $id = ref($param)
? ($param->{id} = trim($param->{id}))
: ($param = trim($param));
ThrowUserError('improper_bug_id_field_value', { field => $field }) unless defined $id;
my $self = $class->new($param);
if ($self->{error}) {
# For error messages, use the id that was returned by new(), because
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment