Skip to content

Commit

Permalink
TEST/MINOR: Prevent nil pointer dereference.
Browse files Browse the repository at this point in the history
Avoid closing a failed connection in e2e test canary-deployment.
  • Loading branch information
Mo3m3n committed Jan 19, 2022
1 parent 4bb3943 commit d0229de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deploy/tests/e2e/canary-deployment/percentage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ func (suite *CanaryDeploymentSuite) Test_Response_Percentage() {
counter := 0
for i := 0; i < 10; i++ {
res, cls, err := suite.client.Do()
suite.NoError(err)
if res == nil {
suite.T().Log(err)
continue
}
defer cls()
if res.StatusCode == 200 {
body, _ := ioutil.ReadAll(res.Body)
Expand Down

0 comments on commit d0229de

Please sign in to comment.