Skip to content

Commit

Permalink
Add nil check for profile
Browse files Browse the repository at this point in the history
Signed-off-by: Jonah Back <jonah@jonahback.com>
  • Loading branch information
backjo committed May 24, 2022
1 parent a1f6192 commit f994628
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/providers/aws/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (w *AwsWorker) CreateScalingGroupRole(name string) (*iam.Role, *iam.Instanc
createdProfile = instanceProfile
}

if len(createdProfile.Roles) == 0 {
if createdProfile != nil && len(createdProfile.Roles) == 0 {
_, err := w.IamClient.AddRoleToInstanceProfile(&iam.AddRoleToInstanceProfileInput{
InstanceProfileName: aws.String(name),
RoleName: aws.String(name),
Expand Down

0 comments on commit f994628

Please sign in to comment.