Skip to content

Commit 561d75c

Browse files
authored
Merge pull request #224 from f1nzer/ns-arg-handling
Namespaces: throw ArgumentException on invalid --namespace
2 parents 1b705bd + 0700ae6 commit 561d75c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

XmlSchemaClassGenerator/CodeUtilities.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,11 @@ internal static string NormalizeNewlines(string text)
365365
public static KeyValuePair<NamespaceKey, string> ParseNamespace(string nsArg, string namespacePrefix)
366366
{
367367
var parts = nsArg.Split(new[] { '=' }, 2);
368+
if (parts.Length != 2)
369+
{
370+
throw new ArgumentException("XML and C# namespaces should be separated by '='.");
371+
}
372+
368373
var xmlNs = parts[0];
369374
var netNs = parts[1];
370375
var parts2 = xmlNs.Split(new[] { '|' }, 2);

0 commit comments

Comments
 (0)