Merge pull request #29784 from xiaozhu36/xiaozhu

backend/oss: Fixes the nil pointer panic error when missing access key or secret key
This commit is contained in:
James Bardin 2021-10-20 16:32:13 -04:00 committed by GitHub
commit 0fcb75020f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -319,7 +319,10 @@ func (b *Backend) configure(ctx context.Context) error {
} }
if endpoint == "" { if endpoint == "" {
endpointsResponse, _ := b.getOSSEndpointByRegion(accessKey, secretKey, securityToken, region) endpointsResponse, err := b.getOSSEndpointByRegion(accessKey, secretKey, securityToken, region)
if err != nil {
return err
}
for _, endpointItem := range endpointsResponse.Endpoints.Endpoint { for _, endpointItem := range endpointsResponse.Endpoints.Endpoint {
if endpointItem.Type == "openAPI" { if endpointItem.Type == "openAPI" {
endpoint = endpointItem.Endpoint endpoint = endpointItem.Endpoint