From 803bc2cfc461a284e15593bc5852c1bc874b0fd2 Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Tue, 16 Jul 2024 11:42:35 +0200 Subject: [PATCH 1/2] fix(appstore): Return an empty array in case of fail Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- lib/private/App/AppStore/Fetcher/AppFetcher.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index f9fbd05855b8d..cd8f7c6b4f414 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -185,6 +185,9 @@ public function get($allowUnstable = false) { $allowPreReleases = $allowUnstable || $this->getChannel() === 'beta' || $this->getChannel() === 'daily' || $this->getChannel() === 'git'; $apps = parent::get($allowPreReleases); + if (empty($apps)) { + return []; + } $allowList = $this->config->getSystemValue('appsallowlist'); // If the admin specified a allow list, filter apps from the appstore From e4a67f271e302c56528ab44408caf37758da9530 Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Tue, 16 Jul 2024 18:13:25 +0200 Subject: [PATCH 2/2] chore: add warning in case of failure Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- lib/private/App/AppStore/Fetcher/AppFetcher.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index cd8f7c6b4f414..3f7f5e0a3bd71 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -186,6 +186,7 @@ public function get($allowUnstable = false) { $apps = parent::get($allowPreReleases); if (empty($apps)) { + $this->logger->warning('Could not get apps from the appstore', ['app' => 'appstoreFetcher']); return []; } $allowList = $this->config->getSystemValue('appsallowlist');