Skip to content

Commit

Permalink
Merge pull request #13 from artemeon/fix/null-response-backport
Browse files Browse the repository at this point in the history
Fixed null response in ResponseException.php
  • Loading branch information
dsimons70 committed Feb 7, 2023
2 parents 3415b22 + ea1c9a5 commit 16dfe24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Exception/Request/Http/ResponseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function fromResponse(
$instance = new static($message, 0, $previous);
$instance->request = $request;
$instance->response = $response;
$instance->statusCode = $response->getStatusCode();
$instance->statusCode = ($response instanceof Response) ? $response->getStatusCode() : 0;

return $instance;
}
Expand Down

0 comments on commit 16dfe24

Please sign in to comment.