From ce45c841c40ba393dd687b17d98ae4e804915c90 Mon Sep 17 00:00:00 2001 From: Shishir Suvarna Date: Wed, 29 Nov 2023 12:33:44 +0530 Subject: [PATCH] Fix error when AppGroup list is empty or doesnt returns appgroups array --- src/Api/ApigeeX/Controller/PaginationHelperTrait.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Api/ApigeeX/Controller/PaginationHelperTrait.php b/src/Api/ApigeeX/Controller/PaginationHelperTrait.php index e0796ae5..4afe9b09 100644 --- a/src/Api/ApigeeX/Controller/PaginationHelperTrait.php +++ b/src/Api/ApigeeX/Controller/PaginationHelperTrait.php @@ -118,7 +118,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);