Fixed an exception when upgrading permissions schemas when the user has no group

This commit is contained in:
Jan Böhmer 2023-01-08 01:21:09 +01:00
parent ec9dcb7975
commit b2157c93e3

View file

@ -110,7 +110,9 @@ class PermissionSchemaUpdater
public function userUpgradeSchemaRecursively(User $user, int $target_version = PermissionData::CURRENT_SCHEMA_VERSION): bool
{
$updated = $this->upgradeSchema($user, $target_version);
if ($user->getGroup()) {
$updated = $this->groupUpgradeSchemaRecursively($user->getGroup(), $target_version) || $updated;
}
return $updated;
}