From 837e006e7f743567c4dc573316d210fcb35cdb5e 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 bb1a0e8948488..bade64c969a14 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -177,6 +177,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 5a29cc51c7bb4d783355c1e46ba4dfe751825b35 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 bade64c969a14..173c0d68437fb 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -178,6 +178,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');