It helps to actually check whether there are groups.
authorJan Schneider <jan@horde.org>
Thu, 3 Jun 2010 12:03:10 +0000 (14:03 +0200)
committerJan Schneider <jan@horde.org>
Thu, 3 Jun 2010 12:03:10 +0000 (14:03 +0200)
framework/Ajax/lib/Horde/Ajax/Application/Base.php

index d68c0b6..f4d11ab 100644 (file)
@@ -139,8 +139,10 @@ abstract class Horde_Ajax_Application_Base
             $groups = empty($GLOBALS['conf']['share']['any_group'])
                 ? $horde_groups->getGroupMemberships($GLOBALS['registry']->getAuth(), true)
                 : $horde_groups->listGroups();
-            asort($groups);
-            $result->groups = $groups;
+            if ($groups) {
+                asort($groups);
+                $result->groups = $groups;
+            }
         } catch (Horde_Group_Exception $e) { }
         return $result;
     }