Skip to content

Commit

Permalink
blueprint: return nil instead of empty user slice in GetUsers()
Browse files Browse the repository at this point in the history
Callers of GetUser() do not expect to receive an empty slice, which is
causing unexpected condition handling.
  • Loading branch information
pastalian authored and achilleas-k committed Sep 2, 2024
1 parent 0ae0f75 commit cfa7280
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/blueprint/customizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func (c *Customizations) GetTimezoneSettings() (*string, []string) {
}

func (c *Customizations) GetUsers() []UserCustomization {
if c == nil {
if c == nil || (c.SSHKey == nil && c.User == nil) {
return nil
}

Expand Down

0 comments on commit cfa7280

Please sign in to comment.