Skip to content

Commit

Permalink
[fix] check len before get list parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongpiger committed Aug 28, 2024
1 parent d3dd267 commit 2ff7cbb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions test/lb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestCreateInterLoadBalancerV2(t *ltesting.T) {
vngcloud := validSuperSdkConfig()
opt := lsinter.NewCreateLoadBalancerRequest(
getValueOfEnv("VNGCLOUD_PORTAL_USER_ID"),
"cuongdm3-test-intervpc",
"phongnt10-test-intervpc",
"lbp-96b6b072-aadb-4b58-9d5f-c16ad69d36aa",
"sub-403b36d2-39fc-47c4-b40b-8df0ecb71045",
"sub-f7770744-6aa4-4292-9ff9-b43b44716ede",
Expand Down Expand Up @@ -96,13 +96,13 @@ func TestCreateInterLoadBalancerSuccess2(t *ltesting.T) {
}

func TestCreateInterVpcLbHcm3b(t *ltesting.T) {
vngcloud := validHcm3bSdkConfig()
vngcloud := validHcm3bSuperSdkConfig()
opt := lsinter.NewCreateLoadBalancerRequest(
getValueOfEnv("HCM3BUSER_ID"),
"cuongdm3-test-create-intervpc",
getValueOfEnv("HCM3B_USER_ID"),
"duynh7-hcm04-vstorage",
"lbp-96b6b072-aadb-4b58-9d5f-c16ad69d36aa",
"sub-69a84d35-5f8c-4220-81ce-a12940277e06",
"sub-a4c0037b-e0db-4f99-8d3b-54f3bddad24e",
"sub-0f20f37a-602c-4b17-b5f8-f81d4c36aab1",
"sub-511ef030-c961-45b5-baac-9d2dadf7e44c",
)
lb, sdkerr := vngcloud.VLBGateway().Internal().LoadBalancerService().CreateLoadBalancer(opt)
if sdkerr != nil {
Expand Down
2 changes: 1 addition & 1 deletion vngcloud/sdk_error/sdk_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (s *SdkError) GetErrorMessages() string {

func (s *SdkError) GetListParameters() []interface{} {
var result []interface{}
if s.parameters == nil {
if s.parameters == nil || len(s.parameters) < 1 {
return result
}

Expand Down

0 comments on commit 2ff7cbb

Please sign in to comment.