diff options
author | Brion Vibber <brion@pobox.com> | 2010-03-30 11:47:23 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-03-30 11:47:49 -0700 |
commit | f694f254a452cf44a7bce0d22f2559e0e3f5fd66 (patch) | |
tree | 03c19a6993c7e987e34b3d5de96d895d370a36ac | |
parent | 034e88bcbceafd47753d4368ce74df85c432abb6 (diff) |
Fix for error output on invalid user ID to api groups list
-rw-r--r-- | actions/apigrouplist.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/actions/apigrouplist.php b/actions/apigrouplist.php index a6f5d03cc..dd2a68c66 100644 --- a/actions/apigrouplist.php +++ b/actions/apigrouplist.php @@ -67,6 +67,12 @@ class ApiGroupListAction extends ApiBareAuthAction parent::prepare($args); $this->user = $this->getTargetUser(null); + + if (empty($this->user)) { + $this->clientError(_('No such user.'), 404, $this->format); + return false; + } + $this->groups = $this->getGroups(); return true; @@ -86,11 +92,6 @@ class ApiGroupListAction extends ApiBareAuthAction { parent::handle($args); - if (empty($this->user)) { - $this->clientError(_('No such user.'), 404, $this->format); - return; - } - $sitename = common_config('site', 'name'); $title = sprintf(_("%s's groups"), $this->user->nickname); $taguribase = TagURI::base(); |