Skip to content

Commit

Permalink
Fix pnp#1075
Browse files Browse the repository at this point in the history
Improves handling custom sort order by checking for empty values.

Also fixes a typo in a comment :)
  • Loading branch information
koskila committed Oct 26, 2024
1 parent 2252a61 commit b2c1547
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,8 @@ from m in termGroup.GroupManagerPrincipalNames
{
var sortOrder = customSortOrder.Split(new[] { ':' }).ToList();

var currentTermIndex = sortOrder.Where(i => new Guid(i) == term.Id).FirstOrDefault();
var currentTermIndex = sortOrder.Where(i => !String.IsNullOrEmpty(i) && new Guid(i) == term.Id).FirstOrDefault();
modelTerm.CustomSortOrder = sortOrder.IndexOf(currentTermIndex) + 1;

}
}
termsToReturn = termsToReturn.OrderBy(t => t.CustomSortOrder).ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public static void MapProperties(Object source, Object destination, Dictionary<S
catch (Exception)
{
// Right now, for testing purposes, I just output and skip any issue
// TODO: Handle issues insteaf of skipping them, we need to find a common pattern
// TODO: Handle issues instead of skipping them, we need to find a common pattern
}
}
}
Expand Down

0 comments on commit b2c1547

Please sign in to comment.