diff --git a/Classes/Domain/Repository/InstagramRepository.php b/Classes/Domain/Repository/InstagramRepository.php index f17d009..7b5b125 100644 --- a/Classes/Domain/Repository/InstagramRepository.php +++ b/Classes/Domain/Repository/InstagramRepository.php @@ -145,6 +145,11 @@ public function getFeed(string $username): array throw new ApiConnectionException('Could not read the feed', 1615757725); } $result = json_decode($request->getBody()->getContents(), true); + foreach ($result['data'] as $key => $feedEntry) { + if (!isset($feedEntry['media_url'])) { + unset($result['data'][$key]); + } + } if (empty($result['data'][0]['id']) || empty($result['data'][0]['media_url']) || empty($result['data'][0]['permalink'])) { throw new ApiConnectionException('Result does not contain expected keys', 1615757825);