Skip to content

Commit

Permalink
Added null checks for baseposition and projecttype
Browse files Browse the repository at this point in the history
  • Loading branch information
aleklundeq committed Sep 2, 2024
1 parent 7078b4c commit f952fa5
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public async Task<IEnumerable<QueryInternalPersonnelPerson>> Handle(GetDepartmen
departmentPersonnel.ForEach(p =>
{
// Filter out all positions of type products
p.PositionInstances = p.PositionInstances.Where(pis => !pis.BasePosition.ProjectType.Equals("Product")).ToList();
p.PositionInstances = p.PositionInstances.Where(pis => pis.BasePosition != null && pis.BasePosition.ProjectType != null && !pis.BasePosition.ProjectType.Equals("Product")).ToList();

p.Absence = departmentAbsence[p.AzureUniqueId];
if (departmentRequests.ContainsKey(p.AzureUniqueId))
Expand Down Expand Up @@ -222,8 +222,6 @@ private async Task<List<QueryInternalPersonnelPerson>> GetDepartmentFromSearchIn
if (managers.Any())
queryString += " or " + string.Join(" or ", managers.Select(m => $"managerAzureId eq '{m}' and isResourceOwner eq true"));



var peopleClient = httpClientFactory.CreateClient(HttpClientNames.ApplicationPeople);

var personnel = await PeopleSearchUtils.GetFromSearchIndexAsync(peopleClient, queryString, requests: requests);
Expand Down

0 comments on commit f952fa5

Please sign in to comment.