Skip to content

Commit

Permalink
add nil check to z.credential
Browse files Browse the repository at this point in the history
  • Loading branch information
goro9 committed Feb 24, 2021
1 parent 2c64b02 commit 22c518f
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 22c518f

Please sign in to comment.