diff --git a/src/Microsoft.Content.Build.Code2Yaml.Steps/GenerateServiceMappingFile.cs b/src/Microsoft.Content.Build.Code2Yaml.Steps/GenerateServiceMappingFile.cs index c062863..160a695 100644 --- a/src/Microsoft.Content.Build.Code2Yaml.Steps/GenerateServiceMappingFile.cs +++ b/src/Microsoft.Content.Build.Code2Yaml.Steps/GenerateServiceMappingFile.cs @@ -57,7 +57,7 @@ select g var oldservices = (from m in oldMapping[0].items from sm in m.items ?? Enumerable.Empty() select new { SM = sm, Name = m.name } - ).ToDictionary(i => new ServiceCategory { Service = i.Name, Category = i.SM.name }, i => i.SM.children.ToList()); + ).ToDictionary(i => new ServiceCategory { Service = i.Name, Category = i.SM.name }, i => i.SM.children?.ToList() ?? new List()); Merge(newservices, oldservices); var other = oldMapping[0].items.SingleOrDefault(i => i.name == "Other"); if (other != null)