summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Object.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm
index 4ee362945..0bb865ea6 100644
--- a/Bugzilla/Object.pm
+++ b/Bugzilla/Object.pm
@@ -134,8 +134,12 @@ sub check {
# We don't want to override the normal template "user" object if
# "user" is one of the params.
delete $param->{user};
- my $error = delete $param->{_error} || 'object_does_not_exist';
- ThrowUserError($error, { %$param, class => $class });
+ if (my $error = delete $param->{_error}) {
+ ThrowUserError($error, { %$param, class => $class });
+ }
+ else {
+ ThrowUserError('object_does_not_exist', { %$param, class => $class });
+ }
}
return $obj;
}