Skip to content

Commit 1e99b00

Browse files
authored
Don't touch resp when err is non nil (Azure#19395)
* Don't touch resp when err is non nil * update changelog in prep for release
1 parent 6838885 commit 1e99b00

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

sdk/data/azappconfig/CHANGELOG.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
# Release History
22

3-
## 0.4.2 (Unreleased)
4-
5-
### Features Added
6-
7-
### Breaking Changes
3+
## 0.4.2 (2022-10-20)
84

95
### Bugs Fixed
10-
11-
### Other Changes
6+
* Fixed a bug in `syncTokenPolicy` that could cause a panic in some conditions.
127

138
## 0.4.1 (2022-09-22)
149

sdk/data/azappconfig/policy_sync_token.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func (policy *syncTokenPolicy) Do(req *policy.Request) (*http.Response, error) {
9595

9696
resp, err := req.Next()
9797

98-
if err != nil {
98+
if err == nil {
9999
for _, st := range resp.Header[syncTokenHeaderName] {
100100
policy.addToken(st)
101101
}

0 commit comments

Comments
 (0)