Skip to content

Commit

Permalink
Merge pull request #200 from goro9/add-nil-check
Browse files Browse the repository at this point in the history
add nil check to z.credential
  • Loading branch information
nukosuke authored Feb 24, 2021
2 parents 2c64b02 + 22c518f commit 2ff4c95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion zendesk/zendesk.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ func (z *Client) delete(ctx context.Context, path string) error {
func (z *Client) prepareRequest(ctx context.Context, req *http.Request) *http.Request {
out := req.WithContext(ctx)
z.includeHeaders(out)
out.SetBasicAuth(z.credential.Email(), z.credential.Secret())
if z.credential != nil {
out.SetBasicAuth(z.credential.Email(), z.credential.Secret())
}

return out
}
Expand Down

0 comments on commit 2ff4c95

Please sign in to comment.