Skip to content

Commit

Permalink
Fix handling of empty response
Browse files Browse the repository at this point in the history
Closes #363
  • Loading branch information
mxr576 authored May 13, 2024
1 parent 13761ed commit 7723559
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Controller/NonPaginatedEntityListingControllerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public function getEntities(): array
$uri = $this->getBaseEndpointUri()->withQuery(http_build_query($query_params));
$response = $this->getClient()->get($uri);
$responseArray = $this->responseToArray($response);
if ($responseArray === []) {
return [];
}
// Ignore entity type key from response, ex.: apiProduct.
$responseArray = reset($responseArray);

Expand Down

0 comments on commit 7723559

Please sign in to comment.