mirror of
https://github.com/kubescape/kubescape.git
synced 2026-04-15 06:58:11 +00:00
check tat control is not nil
This commit is contained in:
@@ -66,13 +66,15 @@ func mapControlToInfo(mapResourceToControls map[string][]string, infoMap map[str
|
||||
for resource, statusInfo := range infoMap {
|
||||
controlIDs := mapResourceToControls[resource]
|
||||
for _, controlID := range controlIDs {
|
||||
resources := controlSummary.GetControl(reportsummary.EControlCriteriaID, controlID).NumberOfResources()
|
||||
if resources != nil {
|
||||
ctrl := controlSummary.GetControl(reportsummary.EControlCriteriaID, controlID)
|
||||
if ctrl != nil {
|
||||
resources := ctrl.NumberOfResources()
|
||||
// Check that there are no K8s resources too
|
||||
if isEmptyResources(resources) {
|
||||
controlToInfoMap[controlID] = statusInfo
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return controlToInfoMap
|
||||
|
||||
Reference in New Issue
Block a user