Null check deleteRoles
[ZITADOPER-1]
This commit is contained in:
@@ -207,6 +207,7 @@ func (wr *wrappedProjectReconciler) reconcileRoles(ctx context.Context, ztdClien
|
||||
}
|
||||
}
|
||||
|
||||
if deleteRoles != nil {
|
||||
for _, dRole := range deleteRoles {
|
||||
if _, err = ztdClient.RemoveProjectRole(middleware.SetOrgID(ctx, org.Status.OrgId), &pb.RemoveProjectRoleRequest{
|
||||
ProjectId: wr.project.Status.ProjectId,
|
||||
@@ -215,6 +216,8 @@ func (wr *wrappedProjectReconciler) reconcileRoles(ctx context.Context, ztdClien
|
||||
return fmt.Errorf("Error removing project role: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(roles) > 0 {
|
||||
_, err = ztdClient.BulkAddProjectRoles(middleware.SetOrgID(ctx, org.Status.OrgId), &pb.BulkAddProjectRolesRequest{
|
||||
ProjectId: wr.project.Status.ProjectId,
|
||||
|
||||
Reference in New Issue
Block a user