Skip to content

Commit

Permalink
Namespaces: throw ArgumentException on invalid --namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
f1nzer committed Sep 11, 2020
1 parent 1b705bd commit 0700ae6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions XmlSchemaClassGenerator/CodeUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,11 @@ internal static string NormalizeNewlines(string text)
public static KeyValuePair<NamespaceKey, string> ParseNamespace(string nsArg, string namespacePrefix)
{
var parts = nsArg.Split(new[] { '=' }, 2);
if (parts.Length != 2)
{
throw new ArgumentException("XML and C# namespaces should be separated by '='.");
}

var xmlNs = parts[0];
var netNs = parts[1];
var parts2 = xmlNs.Split(new[] { '|' }, 2);
Expand Down

0 comments on commit 0700ae6

Please sign in to comment.