diff --git a/lib/Service/Provisioning/Manager.php b/lib/Service/Provisioning/Manager.php index bc69f64e8f..119633966f 100644 --- a/lib/Service/Provisioning/Manager.php +++ b/lib/Service/Provisioning/Manager.php @@ -100,14 +100,20 @@ public function getConfigs(): array { } public function provision(): int { - $cnt = 0; + $counter = 0; + $configs = $this->getConfigs(); - $this->userManager->callForAllUsers(function (IUser $user) use ($configs, &$cnt) { - if ($this->provisionSingleUser($configs, $user) === true) { - $cnt++; + if (count($configs) === 0) { + return $counter; + } + + $this->userManager->callForAllUsers(function (IUser $user) use ($configs, &$counter) { + if ($this->provisionSingleUser($configs, $user)) { + $counter++; } }); - return $cnt; + + return $counter; } /**