Skip to content

Commit

Permalink
Merge pull request #1314 from ucdavis/JCS/SlimService
Browse files Browse the repository at this point in the history
Jcs/slim service
  • Loading branch information
jSylvestre authored Sep 21, 2023
2 parents ecd5a33 + caf2354 commit 8235045
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Keas.Core/Services/IUpdateFromIamService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public async Task<int> UpdateUsersFromLastModifiedDateInIam(DateTime modifiedAft
foreach (var user in users)
{
var ietData = result.ResponseData.Results.Where(a => a.IamId == user.Iam).FirstOrDefault();
if (ietData != null)
//Possible to get null data back for a user. Probably because they are going away
if (ietData != null && !string.IsNullOrWhiteSpace(ietData.DFirstName) && !string.IsNullOrWhiteSpace(ietData.DLastName))
{
if (user.FirstName != ietData.DFirstName || user.LastName != ietData.DLastName)
{
Expand Down Expand Up @@ -87,6 +88,7 @@ public async Task<int> UpdateUsersFromLastModifiedDateInIam(DateTime modifiedAft
catch (Exception ex)
{
Log.Error("Update IAM by Modified Date - Getting List of Users to Update.", ex);
Log.Error($"Update IAM by Modified Date - Exception Message: {ex.Message} -- {ex.InnerException.Message}");
}
return count;
}
Expand Down Expand Up @@ -119,7 +121,7 @@ public async Task<int> UpdateAllUsersFromIam()
if (result != null && result.ResponseData.Results.Length > 0)
{
var ietData = result.ResponseData.Results.Where(a => a.IamId == user.Iam).FirstOrDefault();
if (ietData == null)
if (ietData == null || string.IsNullOrWhiteSpace(ietData.DFirstName) || string.IsNullOrWhiteSpace(ietData.DLastName))
{
continue;
}
Expand Down
1 change: 1 addition & 0 deletions Keas.Jobs.LivedName/Keas.Jobs.LivedName.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<UserSecretsId>93abda06-2870-4006-81e8-1eecba3d977c</UserSecretsId>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyVersion>1.0.0.1</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 8235045

Please sign in to comment.