diff --git a/src/Illuminate/Http/Client/PendingRequest.php b/src/Illuminate/Http/Client/PendingRequest.php index ff0213324772..40e1d9d88f9b 100644 --- a/src/Illuminate/Http/Client/PendingRequest.php +++ b/src/Illuminate/Http/Client/PendingRequest.php @@ -790,7 +790,7 @@ protected function makePromise(string $method, string $url, array $options = []) }); }) ->otherwise(function (TransferException $e) { - return $e instanceof RequestException ? $this->populateResponse(new Response($e->getResponse())) : $e; + return $e instanceof RequestException && $e->hasResponse() ? $this->populateResponse(new Response($e->getResponse())) : $e; }); }