@joebigelow / wix-1 / commits / 4edebcf6

Section ids are optional

Rob Mensching committed May 12, 2019 at 15:50 UTC 4edebcf64d4646acd89ba9c1d66597f91002e4e2
1 file changed +2 -7
src/WixToolset.Data/IntermediateSection.cs
+2 -7
@@ -1,4 +1,4 @@
1 -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
1 +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3 namespace WixToolset.Data
4 {
@@ -67,14 +67,9 @@ namespace WixToolset.Data
67 var id = jsonObject.GetValueOrDefault<string>("id");
68 var type = jsonObject.GetEnumOrDefault("type", SectionType.Unknown);
69
70 - if (null == id && (SectionType.Unknown != type && SectionType.Fragment != type))
71 - {
72 - throw new ArgumentException("JSON object is not a valid section");
73 - }
74 -
70 if (SectionType.Unknown == type)
71 {
77 - throw new ArgumentException("JSON object is not a valid section", nameof(type));
72 + throw new ArgumentException("JSON object is not a valid section, unknown section type", nameof(type));
73 }
74
75 var section = new IntermediateSection(id, type, codepage);