From a0d02139d10dd0db8e527ba6187e844b21ab3c5d Mon Sep 17 00:00:00 2001 From: adfrth5 Date: Fri, 1 May 2020 09:12:40 +0200 Subject: [PATCH] map empty default string to empty array instead of raising an exception --- XmlSchemaClassGenerator/TypeModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XmlSchemaClassGenerator/TypeModel.cs b/XmlSchemaClassGenerator/TypeModel.cs index 9bb176db..fd3a9912 100644 --- a/XmlSchemaClassGenerator/TypeModel.cs +++ b/XmlSchemaClassGenerator/TypeModel.cs @@ -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];