]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix for error output on invalid user ID to api groups list
authorBrion Vibber <brion@pobox.com>
Tue, 30 Mar 2010 18:47:23 +0000 (11:47 -0700)
committerBrion Vibber <brion@pobox.com>
Tue, 30 Mar 2010 18:47:23 +0000 (11:47 -0700)
actions/apigrouplist.php

index a6f5d03ccf38dacf0c8117e267b607ae57232e9c..dd2a68c66e9089fde8f63cc02c526ca05ad8dd4f 100644 (file)
@@ -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();