From 63f19661d2bc4c111ad21df15ad57174d0fa2403 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Fri, 22 Mar 2024 15:01:16 +0100 Subject: fix(AppStore\Fetcher): Ensure `get` returns an array When fetch fails and the `data` prop contains null (e.g. `json_decode` failed), then we should return an empty array instead of null. Signed-off-by: Ferdinand Thiessen --- lib/private/App/AppStore/Fetcher/Fetcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php index bd5c2ba8213..75d2069d07a 100644 --- a/lib/private/App/AppStore/Fetcher/Fetcher.php +++ b/lib/private/App/AppStore/Fetcher/Fetcher.php @@ -181,7 +181,7 @@ abstract class Fetcher { try { $responseJson = $this->fetch($ETag, $content, $allowUnstable); - if (empty($responseJson)) { + if (empty($responseJson) || empty($responseJson['data'])) { return []; } -- cgit v1.2.3