From c6ed39a5865c67088bc7cebdc9939bddd08a1074 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Fri, 5 Feb 2010 22:58:57 +0100 Subject: Bug 543986: False positive in 012throwables.t, 'object_does_not_exist' is still in use r/a=mkanat --- Bugzilla/Object.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Object.pm') 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; } -- cgit v1.2.3-24-g4f1b