diff --git a/src/lib/PnP.Framework/Provisioning/ObjectHandlers/ObjectTermGroups.cs b/src/lib/PnP.Framework/Provisioning/ObjectHandlers/ObjectTermGroups.cs index 07e4e23d5..ce00f8f7b 100644 --- a/src/lib/PnP.Framework/Provisioning/ObjectHandlers/ObjectTermGroups.cs +++ b/src/lib/PnP.Framework/Provisioning/ObjectHandlers/ObjectTermGroups.cs @@ -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(); diff --git a/src/lib/PnP.Framework/Provisioning/Providers/Xml/PnPObjectsMapper.cs b/src/lib/PnP.Framework/Provisioning/Providers/Xml/PnPObjectsMapper.cs index f4822c3f2..17b60cea1 100644 --- a/src/lib/PnP.Framework/Provisioning/Providers/Xml/PnPObjectsMapper.cs +++ b/src/lib/PnP.Framework/Provisioning/Providers/Xml/PnPObjectsMapper.cs @@ -218,7 +218,7 @@ public static void MapProperties(Object source, Object destination, Dictionary