From ab99f202a85459b79b34208eecbc8b0f877f3c3c Mon Sep 17 00:00:00 2001 From: Shishir Suvarna Date: Tue, 5 Dec 2023 13:17:04 +0530 Subject: [PATCH] Fix error when AppGroup list is empty or do not 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 3747e17a..5aaa6eff 100644 --- a/src/Api/ApigeeX/Controller/PaginationHelperTrait.php +++ b/src/Api/ApigeeX/Controller/PaginationHelperTrait.php @@ -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);