aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Setup.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2019-10-09 19:13:27 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2019-11-25 14:01:25 +0100
commit7ff15c975694f838a21e8e40cc03e21da83fdf97 (patch)
tree365ab9a9a63837693602e6a50d82542e6bd20494 /lib/private/Setup.php
parent7b1eedb11e5f55d563831d8e58c44e615267669c (diff)
downloadnextcloud-server-7ff15c975694f838a21e8e40cc03e21da83fdf97.tar.gz
nextcloud-server-7ff15c975694f838a21e8e40cc03e21da83fdf97.zip
fix documentation, get and createGroup may return null
* also have stricter checks in place Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/private/Setup.php')
-rw-r--r--lib/private/Setup.php5
1 files changed, 4 insertions, 1 deletions
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();