Skip to content

Commit ebe467d

Browse files
Check if the http Client is nil (#14132) (#23070)
[upstream:89b90c054232fba6a435596b114af78dea534c78] Signed-off-by: Modular Magician <[email protected]>
1 parent 11a1156 commit ebe467d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

google/transport/transport.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ type SendRequestOptions struct {
4646
}
4747

4848
func SendRequest(opt SendRequestOptions) (map[string]interface{}, error) {
49+
if opt.Config == nil || opt.Config.Client == nil {
50+
return nil, fmt.Errorf("client is nil for request to %s", opt.RawURL)
51+
}
52+
4953
reqHeaders := opt.Headers
5054
if reqHeaders == nil {
5155
reqHeaders = make(http.Header)

0 commit comments

Comments
 (0)