diff --git a/Adapter/PlentymarketsAdapter/Client/Client.php b/Adapter/PlentymarketsAdapter/Client/Client.php index fddd37204..593f9fef9 100644 --- a/Adapter/PlentymarketsAdapter/Client/Client.php +++ b/Adapter/PlentymarketsAdapter/Client/Client.php @@ -5,7 +5,6 @@ use Assert\Assertion; use Closure; use Exception; -use GuzzleHttp\Client as GuzzleClient; use GuzzleHttp\ClientInterface as GuzzleClientInterface; use GuzzleHttp\Exception\ClientException; use GuzzleHttp\Exception\ServerException; @@ -44,11 +43,11 @@ class Client implements ClientInterface /** * Client constructor. * - * @param GuzzleClient $connection + * @param GuzzleClientInterface $connection * @param ConfigServiceInterface $config */ public function __construct( - GuzzleClient $connection, + GuzzleClientInterface $connection, ConfigServiceInterface $config ) { $this->connection = $connection; @@ -115,6 +114,10 @@ public function request($method, $path, array $params = [], $limit = null, $offs try { $response = $this->connection->send($request); + if (null === $response) { + throw InvalidResponseException::fromParams($method, $path, $options); + } + $body = $response->getBody(); if (null === $body) {