]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Minor script fixes
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 19 May 2014 12:46:35 +0000 (14:46 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 19 May 2014 12:46:35 +0000 (14:46 +0200)
scripts/joingroup.php
scripts/leavegroup.php

index e1359a7674bf1db03536fdd199b979143d2d4a16..bd73cbe79460b2c6788147237a7945367f4ebc98 100644 (file)
@@ -23,7 +23,7 @@ $shortoptions = 'i:n:g:G:';
 $longoptions = array('id=', 'nickname=', 'group=', 'group-id=');
 
 $helptext = <<<END_OF_HELP
-addusertogroup.php [options]
+joingroup.php [options]
 
 Adds a local user to a local group.
 
@@ -46,7 +46,7 @@ try {
         $gnick = get_option_value('g', 'group');
         $lgroup = Local_group::getKV('nickname', $gnick);
     }
-    if (empty($lgroup)) {
+    if (!$lgroup instanceof Local_group) {
         throw new Exception("No such local group: $gnick");
     }
     $group = User_group::getKV('id', $lgroup->group_id);
index 29282066054eb3802323620e05954cbca8bae599..8f9ef33e7edb2d33b2615d0023506e8479f489f5 100644 (file)
@@ -46,7 +46,7 @@ try {
         $gnick = get_option_value('g', 'group');
         $lgroup = Local_group::getKV('nickname', $gnick);
     }
-    if (empty($lgroup)) {
+    if (!$lgroup instanceof Local_group) {
         throw new Exception("No such local group: $gnick");
     }
     $group = User_group::getKV('id', $lgroup->group_id);