Skip to content

Commit 2ac1945

Browse files
committed
Fix null response.
1 parent 179e8fc commit 2ac1945

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Exception/RequestException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(
2626
\Exception $previous = null
2727
) {
2828
$code = $code ? $code : ($response ? $response->getStatusCode() : 0);
29-
$phrase = $response->getReasonPhrase();
29+
$phrase = $response ? $response->getReasonPhrase() : 'Unknown';
3030
parent::__construct("HTTP {$code} {$phrase}: {$message}", $code, $previous);
3131
$this->request = $request;
3232
$this->response = $response;

0 commit comments

Comments
 (0)