fixes 4240; added null check on namespace when resource is a RoleBinding

This commit is contained in:
m-Bilal
2021-11-27 19:53:49 +05:30
parent 25ee506af4
commit b28f1e55b7

View File

@@ -436,7 +436,9 @@ func getNamespacesForRoleBinding(r *resource.Resource) map[string]bool {
if ns, ok1 := subject["namespace"]; ok1 {
if kind, ok2 := subject["kind"]; ok2 {
if kind.(string) == "ServiceAccount" {
result[ns.(string)] = true
if n, ok3 := ns.(string); ok3 {
result[n] = true
}
}
}
}