Add nil check when checking setup software (#30520)
Quick nil check + test to check that it works. Test fails with panic on main, works on this branch.
This commit is contained in:
@@ -926,7 +926,8 @@ func (cmd *GenerateGitopsCommand) generateControls(teamId *uint, teamName string
|
||||
}
|
||||
hasSetupSoftware := false
|
||||
for _, software := range setupSoftware {
|
||||
if software.SoftwarePackage.InstallDuringSetup != nil && *software.SoftwarePackage.InstallDuringSetup {
|
||||
pkg := software.SoftwarePackage
|
||||
if pkg != nil && pkg.InstallDuringSetup != nil && *pkg.InstallDuringSetup {
|
||||
hasSetupSoftware = true
|
||||
break
|
||||
}
|
||||
|
||||
@@ -420,6 +420,11 @@ func (MockClient) GetSetupExperienceSoftware(teamID uint) ([]fleet.SoftwareTitle
|
||||
Version: "13.37",
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: 2,
|
||||
Name: "My Other Software Package",
|
||||
HashSHA256: ptr.String("software-package-hash"),
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
if teamID == 0 || teamID == 3 || teamID == 4 || teamID == 5 {
|
||||
|
||||
Reference in New Issue
Block a user