diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-07-10 19:01:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-10 19:01:43 +0200 |
commit | 2071f4d7133fa26da9290b132bac83f6a3f6387c (patch) | |
tree | 280ccf4a840ec2c11c261a8e2f21aef3dade736e /lib/private | |
parent | cc2ed78dd6c5c09148f18e4ffc0a80c266240afa (diff) | |
parent | 57c889f77322a25be6691db768dc4ffd115ce3d7 (diff) | |
download | nextcloud-server-2071f4d7133fa26da9290b132bac83f6a3f6387c.tar.gz nextcloud-server-2071f4d7133fa26da9290b132bac83f6a3f6387c.zip |
Merge pull request #46298 from nextcloud/backport/46174/stable29
[stable29] fix(IntegrityCheck): Ensure the check is run if no results are available
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/IntegrityCheck/Checker.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/private/IntegrityCheck/Checker.php b/lib/private/IntegrityCheck/Checker.php index e8fd087ebc2..b17e4b1c0bf 100644 --- a/lib/private/IntegrityCheck/Checker.php +++ b/lib/private/IntegrityCheck/Checker.php @@ -396,7 +396,7 @@ class Checker { */ public function hasPassedCheck(): bool { $results = $this->getResults(); - if (empty($results)) { + if ($results !== null && empty($results)) { return true; } @@ -404,15 +404,20 @@ class Checker { } /** - * @return array + * @return array|null Either the results or null if no results available */ - public function getResults(): array { + public function getResults(): array|null { $cachedResults = $this->cache->get(self::CACHE_KEY); if (!\is_null($cachedResults) and $cachedResults !== false) { return json_decode($cachedResults, true); } - return $this->appConfig?->getValueArray('core', self::CACHE_KEY, lazy: true) ?? []; + if ($this->appConfig?->hasKey('core', self::CACHE_KEY, lazy: true)) { + return $this->appConfig->getValueArray('core', self::CACHE_KEY, lazy: true); + } + + // No results available + return null; } /** @@ -422,7 +427,7 @@ class Checker { * @param array $result */ private function storeResults(string $scope, array $result) { - $resultArray = $this->getResults(); + $resultArray = $this->getResults() ?? []; unset($resultArray[$scope]); if (!empty($result)) { $resultArray[$scope] = $result; |