From 91965dc3704a4763086c30ddebd8477ece47d942 Mon Sep 17 00:00:00 2001 From: Harry Metske Date: Tue, 23 Jan 2024 10:54:16 +0100 Subject: [PATCH] minor error handling improvement for empty UPN's --- user/azureAD_users.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/azureAD_users.go b/user/azureAD_users.go index 1b3120c3..e845c5c6 100644 --- a/user/azureAD_users.go +++ b/user/azureAD_users.go @@ -24,7 +24,7 @@ func (m *DefaultManager) SyncAzureADUsers(roleUsers *role.RoleUsers, usersInput userID := userToUse.Upn uaaUser := m.UAAUsers.GetByNameAndOrigin(userID, origin) lo.G.Debugf("SyncAzureADUsers: Processing user: %s", userID) - if uaaUser == nil { + if uaaUser == nil && userToUse.Upn != "" { lo.G.Debugf("AAD User %s doesn't exist in cloud foundry, so creating user", userToUse.Upn) if userGUID, err := m.UAAMgr.CreateExternalUser(userToUse.Upn, userToUse.Upn, userToUse.Upn, m.AzureADConfig.UserOrigin); err != nil { lo.G.Errorf("Unable to create AAD user %s with error %s", userToUse.Upn, err.Error())