]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 543986: False positive in 012throwables.t, 'object_does_not_exist' is still in use
authorFrédéric Buclin <LpSolit@gmail.com>
Fri, 5 Feb 2010 22:00:41 +0000 (23:00 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Fri, 5 Feb 2010 22:00:41 +0000 (23:00 +0100)
r/a=mkanat

Bugzilla/Object.pm

index 4ee362945a27422f66b0dead4db99c1bacead3a9..0bb865ea60b3627d69302f3f7628472ef454b837 100644 (file)
@@ -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;
 }