summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Group/Manager.php8
-rw-r--r--lib/private/Setup.php5
-rw-r--r--lib/public/IGroupManager.php4
3 files changed, 10 insertions, 7 deletions
diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php
index b372eb1786e..9ae25be27f5 100644
--- a/lib/private/Group/Manager.php
+++ b/lib/private/Group/Manager.php
@@ -163,7 +163,7 @@ class Manager extends PublicEmitter implements IGroupManager {
/**
* @param string $gid
- * @return \OC\Group\Group
+ * @return IGroup|null
*/
public function get($gid) {
if (isset($this->cachedGroups[$gid])) {
@@ -175,7 +175,7 @@ class Manager extends PublicEmitter implements IGroupManager {
/**
* @param string $gid
* @param string $displayName
- * @return \OCP\IGroup
+ * @return \OCP\IGroup|null
*/
protected function getGroupObject($gid, $displayName = null) {
$backends = [];
@@ -210,11 +210,11 @@ class Manager extends PublicEmitter implements IGroupManager {
/**
* @param string $gid
- * @return IGroup|bool|null
+ * @return IGroup|null
*/
public function createGroup($gid) {
if ($gid === '' || $gid === null) {
- return false;
+ return null;
} else if ($group = $this->get($gid)) {
return $group;
} else {
diff --git a/lib/private/Setup.php b/lib/private/Setup.php
index d7c6df3535a..a23ce2dbb0e 100644
--- a/lib/private/Setup.php
+++ b/lib/private/Setup.php
@@ -50,6 +50,7 @@ use OC\Authentication\Token\DefaultTokenProvider;
use OC\Log\Rotate;
use OC\Preview\BackgroundCleanupJob;
use OCP\Defaults;
+use OCP\IGroup;
use OCP\IL10N;
use OCP\ILogger;
use OCP\IUser;
@@ -380,7 +381,9 @@ class Setup {
$config->setAppValue('core', 'vendor', $this->getVendor());
$group =\OC::$server->getGroupManager()->createGroup('admin');
- $group->addUser($user);
+ if($group instanceof IGroup) {
+ $group->addUser($user);
+ }
// Install shipped apps and specified app bundles
Installer::installShippedApps();
diff --git a/lib/public/IGroupManager.php b/lib/public/IGroupManager.php
index f7a63dfefb7..d8a557777bc 100644
--- a/lib/public/IGroupManager.php
+++ b/lib/public/IGroupManager.php
@@ -75,7 +75,7 @@ interface IGroupManager {
/**
* @param string $gid
- * @return \OCP\IGroup
+ * @return \OCP\IGroup|null
* @since 8.0.0
*/
public function get($gid);
@@ -89,7 +89,7 @@ interface IGroupManager {
/**
* @param string $gid
- * @return \OCP\IGroup
+ * @return \OCP\IGroup|null
* @since 8.0.0
*/
public function createGroup($gid);