summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Object.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Object.pm')
-rw-r--r--Bugzilla/Object.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm
index cfa2bfeb6..bb8b45d76 100644
--- a/Bugzilla/Object.pm
+++ b/Bugzilla/Object.pm
@@ -121,8 +121,13 @@ sub check {
my $check_param = exists $param->{id} ? $param->{id} : $param->{name};
$check_param = trim($check_param);
$check_param || ThrowUserError('object_not_specified', { class => $class });
- my $obj = $class->new($param)
- || ThrowUserError('object_does_not_exist', {%$param, class => $class});
+ my $obj = $class->new($param);
+ if (!$obj) {
+ # We don't want to override the normal template "user" object if
+ # "user" is one of the params.
+ delete $param->{user};
+ ThrowUserError('object_does_not_exist', { %$param, class => $class });
+ }
return $obj;
}