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:
commit
0fcb75020f
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue