Skip to content

Commit

Permalink
Fix error when AppGroup list is empty or do not returns appgroups array
Browse files Browse the repository at this point in the history
  • Loading branch information
shishir-intelli committed Dec 5, 2023
1 parent 2b3b7a6 commit ab99f20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Api/ApigeeX/Controller/PaginationHelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ protected function listEntities(PagerInterface $pager = null, array $query_param
// Ignore entity type key from response, ex.: developer, apiproduct,
// etc.
$responseArray = reset($responseArray);
if (empty($responseArray)) {
// Appgroup can be empty.
if (empty($responseArray) || !is_array($responseArray)) {
return [];
}
$entities = $this->responseArrayToArrayOfEntities($responseArray, $key_provider);
Expand Down

0 comments on commit ab99f20

Please sign in to comment.