]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix error handling for missing group in apigroupmembership -- was trying to call...
authorBrion Vibber <brion@pobox.com>
Sat, 8 Jan 2011 00:25:58 +0000 (16:25 -0800)
committerBrion Vibber <brion@pobox.com>
Sat, 8 Jan 2011 00:25:58 +0000 (16:25 -0800)
actions/apigroupmembership.php

index 99ac965fa18d2c5aa9de82cf91ef317a3be8e025..939d22d757fb5a2f2c19939bc1dd903352f30144 100644 (file)
@@ -66,6 +66,12 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
         parent::prepare($args);
 
         $this->group    = $this->getTargetGroup($this->arg('id'));
+        if (empty($this->group)) {
+            // TRANS: Client error displayed trying to show group membership on a non-existing group.
+            $this->clientError(_('Group not found.'), 404, $this->format);
+            return false;
+        }
+
         $this->profiles = $this->getProfiles();
 
         return true;
@@ -84,12 +90,6 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
     {
         parent::handle($args);
 
-        if (empty($this->group)) {
-            // TRANS: Client error displayed trying to show group membership on a non-existing group.
-            $this->clientError(_('Group not found.'), 404, $this->format);
-            return false;
-        }
-
         // XXX: RSS and Atom
 
         switch($this->format) {