diff --git a/src/Controller/NonPaginatedEntityListingControllerTrait.php b/src/Controller/NonPaginatedEntityListingControllerTrait.php index 807302b5..c98e4067 100644 --- a/src/Controller/NonPaginatedEntityListingControllerTrait.php +++ b/src/Controller/NonPaginatedEntityListingControllerTrait.php @@ -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);