diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-11-05 16:17:24 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-11-25 14:01:25 +0100 |
commit | b4408e4245ca4045df7a5f8fdf6ba9100730fa4f (patch) | |
tree | 0e8f8ff9365a2a0ea893b74f027629319a938d7e /core | |
parent | cdf8c16942c71d0faf71b346beaad70ced22a2fa (diff) | |
download | nextcloud-server-b4408e4245ca4045df7a5f8fdf6ba9100730fa4f.tar.gz nextcloud-server-b4408e4245ca4045df7a5f8fdf6ba9100730fa4f.zip |
fix and improve check of create group result
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'core')
-rw-r--r-- | core/Command/Group/Add.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/Command/Group/Add.php b/core/Command/Group/Add.php index 284cf7a3e9d..4850ec9ce6c 100644 --- a/core/Command/Group/Add.php +++ b/core/Command/Group/Add.php @@ -25,6 +25,7 @@ declare(strict_types=1); namespace OC\Core\Command\Group; use OC\Core\Command\Base; +use OCP\IGroup; use OCP\IGroupManager; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -68,16 +69,17 @@ class Add extends Base { return 1; } else { $group = $this->groupManager->createGroup($gid); - if($group === false) { + if (!$group instanceof IGroup) { $output->writeln('<error>Could not create group</error>'); return 2; } $output->writeln('Created group "' . $group->getGID() . '"'); - $displayName = trim((string) $input->getOption('display-name')); + $displayName = trim((string)$input->getOption('display-name')); if ($displayName !== '') { $group->setDisplayName($displayName); } } + return 0; } } |