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 <opensource@fthiessen.de>
pull/44410/head
Ferdinand Thiessen 2 years ago
parent 4121b841de
commit 63f19661d2
No known key found for this signature in database
GPG Key ID: 45FAE7268762B400
  1. 2
      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 [];
}

Loading…
Cancel
Save