Skip to content
This repository has been archived by the owner on Feb 12, 2025. It is now read-only.

Commit

Permalink
response is sometimes nil when error is not nil (#278)
Browse files Browse the repository at this point in the history
* response is sometimes nil

* Updating Changelog
  • Loading branch information
devigned authored and marstr committed May 19, 2018
1 parent eaa7994 commit 9157a90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## v10.8.2

### Bug Fixes

- Add nil-gaurd to token retry logic.

## v10.8.1

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion autorest/adal/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ func retry(sender Sender, req *http.Request) (resp *http.Response, err error) {
for attempt < maxAttempts {
resp, err = sender.Do(req)
// retry on temporary network errors, e.g. transient network failures.
if (err != nil && !isTemporaryNetworkError(err)) || resp.StatusCode == http.StatusOK || !containsInt(retries, resp.StatusCode) {
if (err != nil && !isTemporaryNetworkError(err)) || (err != nil && resp == nil) || resp.StatusCode == http.StatusOK || !containsInt(retries, resp.StatusCode) {
return
}

Expand Down

0 comments on commit 9157a90

Please sign in to comment.