fix nil pointer dereference

This commit is contained in:
Michael Yang 2023-09-07 17:24:31 -07:00
parent 63def6ca49
commit de227b620f

View file

@ -1300,7 +1300,7 @@ func makeRequestWithRetry(ctx context.Context, method string, requestURL *url.UR
} }
func makeRequest(ctx context.Context, method string, requestURL *url.URL, headers http.Header, body io.Reader, regOpts *RegistryOptions) (*http.Response, error) { func makeRequest(ctx context.Context, method string, requestURL *url.URL, headers http.Header, body io.Reader, regOpts *RegistryOptions) (*http.Response, error) {
if requestURL.Scheme != "http" && regOpts.Insecure { if requestURL.Scheme != "http" && regOpts != nil && regOpts.Insecure {
requestURL.Scheme = "http" requestURL.Scheme = "http"
} }