Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit abcd7a0

Browse files
aramasekkmsft
authored andcommitted
Check identity ids exists before return (#403)
1 parent b8e4dde commit abcd7a0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pkg/cloudprovider/vm.go

+3
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,8 @@ func (i *vmIdentityInfo) AppendUserIdentity(id string) bool {
126126
}
127127

128128
func (i *vmIdentityInfo) GetUserIdentityList() []string {
129+
if i.info.IdentityIds == nil {
130+
return []string{}
131+
}
129132
return *i.info.IdentityIds
130133
}

pkg/cloudprovider/vmss.go

+3
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,8 @@ func (i *vmssIdentityInfo) AppendUserIdentity(id string) bool {
134134
}
135135

136136
func (i *vmssIdentityInfo) GetUserIdentityList() []string {
137+
if i.info.IdentityIds == nil {
138+
return []string{}
139+
}
137140
return *i.info.IdentityIds
138141
}

0 commit comments

Comments
 (0)