Skip to content

Commit c3ca2e6

Browse files
authored
fix(init): fix panic (#1082)
1 parent 95abef7 commit c3ca2e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/account/test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ func InjectHttpClient(ctx context.Context, httpClient *http.Client) context.Cont
1818
}
1919

2020
func extractHttpClient(ctx context.Context) *http.Client {
21-
httpClient := ctx.Value(contextKey).(*http.Client)
22-
if httpClient != nil {
21+
httpClient, isHttpClient := ctx.Value(contextKey).(*http.Client)
22+
if httpClient != nil && isHttpClient {
2323
return httpClient
2424
}
2525
return http.DefaultClient

0 commit comments

Comments
 (0)