backend/oss: Fixes the nil pointer panic error when missing access key or secret key
This commit is contained in:
parent
cdd5ee6fb3
commit
7afaea4cf2
|
@ -319,7 +319,10 @@ func (b *Backend) configure(ctx context.Context) error {
|
|||
}
|
||||
|
||||
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 {
|
||||
if endpointItem.Type == "openAPI" {
|
||||
endpoint = endpointItem.Endpoint
|
||||
|
|
Loading…
Reference in New Issue