Skip to content

Commit 575bf38

Browse files
gtwngtwn
and
gtwn
authored
fix: handle nil credentials before clone (#990)
Co-authored-by: gtwn <[email protected]>
1 parent e158f04 commit 575bf38

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

client.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -2193,7 +2193,11 @@ func (c *Client) Clone(ctx context.Context) *Client {
21932193
cc.formData = cloneURLValues(c.formData)
21942194
cc.header = c.header.Clone()
21952195
cc.pathParams = maps.Clone(c.pathParams)
2196-
cc.credentials = c.credentials.Clone()
2196+
2197+
if c.credentials != nil {
2198+
cc.credentials = c.credentials.Clone()
2199+
}
2200+
21972201
cc.contentTypeEncoders = maps.Clone(c.contentTypeEncoders)
21982202
cc.contentTypeDecoders = maps.Clone(c.contentTypeDecoders)
21992203
cc.contentDecompressers = maps.Clone(c.contentDecompressers)

0 commit comments

Comments
 (0)