Skip to content

Commit bf98b60

Browse files
committed
Add nil check for profile
1 parent a1f6192 commit bf98b60

File tree

1 file changed

+1
-1
lines changed
  • controllers/providers/aws

1 file changed

+1
-1
lines changed

controllers/providers/aws/iam.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func (w *AwsWorker) CreateScalingGroupRole(name string) (*iam.Role, *iam.Instanc
218218
createdProfile = instanceProfile
219219
}
220220

221-
if len(createdProfile.Roles) == 0 {
221+
if createdProfile != nil && len(createdProfile.Roles) == 0 {
222222
_, err := w.IamClient.AddRoleToInstanceProfile(&iam.AddRoleToInstanceProfileInput{
223223
InstanceProfileName: aws.String(name),
224224
RoleName: aws.String(name),

0 commit comments

Comments
 (0)