From 37dd76728447c69d73a151a422f111b521f01ede Mon Sep 17 00:00:00 2001 From: xuzho Date: Thu, 15 Jun 2017 11:26:55 +0800 Subject: [PATCH] fix mapping: children might be null --- .../GenerateServiceMappingFile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)