Skip to content

Commit

Permalink
Fix handling of empty response
Browse files Browse the repository at this point in the history
Closes apigee#363
  • Loading branch information
mxr576 committed May 13, 2024
1 parent 13761ed commit d4578ec
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 d4578ec

Please sign in to comment.