Skip to content

Commit

Permalink
Merge pull request #193 from TFTomSun/AllowEmptyArrayInitalization
Browse files Browse the repository at this point in the history
map empty default string to empty array instead of raising an exception
  • Loading branch information
mganss authored May 1, 2020
2 parents dccda08 + a0d0213 commit 88f0d12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion XmlSchemaClassGenerator/TypeModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,7 @@ public override CodeExpression GetDefaultValueFor(string defaultString, bool att
else
return new CodePrimitiveExpression(Convert.ChangeType(defaultString, ValueType));
}
else if (type == typeof(byte[]) && !string.IsNullOrWhiteSpace(defaultString))
else if (type == typeof(byte[]) && defaultString != null)
{
int numberChars = defaultString.Length;
var byteValues = new CodePrimitiveExpression[numberChars / 2];
Expand Down

0 comments on commit 88f0d12

Please sign in to comment.