Skip to content

Commit

Permalink
fix: do not use object that is nil on error to register an error with…
Browse files Browse the repository at this point in the history
… on update test (#3848)
  • Loading branch information
vLia committed May 16, 2023
1 parent 4742a5a commit 78f09c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/app/api/v1/tests.go
Expand Up @@ -486,7 +486,7 @@ func (s TestkubeAPI) UpdateTestHandler() fiber.Handler {
updatedTest, err = s.TestsClient.Update(testSpec)
}

s.Metrics.IncUpdateTest(updatedTest.Spec.Type_, err)
s.Metrics.IncUpdateTest(testSpec.Spec.Type_, err)

if err != nil {
return s.Error(c, http.StatusBadGateway, fmt.Errorf("%s: client could not update test %w", errPrefix, err))
Expand Down

0 comments on commit 78f09c6

Please sign in to comment.