@@ -136,6 +136,9 @@ IEnumerable<string> GetScalarArguments()
136
136
yield break ;
137
137
138
138
var value = Parse ( token , property . PropertyType ) ;
139
+ if ( value . IsNullOrWhiteSpace ( ) )
140
+ yield break ;
141
+
139
142
foreach ( var part in formatParts )
140
143
yield return part . Replace ( ValuePlaceholder , value ) ;
141
144
}
@@ -145,7 +148,7 @@ IEnumerable<string> GetListArguments()
145
148
Assert . True ( formatParts . Length <= 2 ) ;
146
149
147
150
var valueType = property . PropertyType . GetScalarType ( ) ;
148
- var values = token . Value < JArray > ( ) . Select ( x => Parse ( x , valueType ) ) ;
151
+ var values = token . Value < JArray > ( ) . Select ( x => Parse ( x , valueType ) ) . Where ( x => ! x . IsNullOrWhiteSpace ( ) ) ;
149
152
150
153
if ( attribute . Separator == null )
151
154
{
@@ -175,7 +178,8 @@ from part in formatParts
175
178
IEnumerable < string > GetDictionaryArguments ( )
176
179
{
177
180
var valueType = property . PropertyType . GetGenericArguments ( ) . Last ( ) ;
178
- var pairs = token . Value < JObject > ( ) . Properties ( ) . Select ( x => ( Key : x . Name , Value : Parse ( x , valueType ) ) ) ;
181
+ var pairs = token . Value < JObject > ( ) . Properties ( ) . Select ( x => ( Key : x . Name , Value : Parse ( x , valueType ) ) )
182
+ . Where ( x => ! x . Value . IsNullOrWhiteSpace ( ) ) ;
179
183
180
184
if ( attribute . Separator == null )
181
185
{
@@ -205,7 +209,7 @@ IEnumerable<string> GetLookupArguments()
205
209
{
206
210
var valueType = property . PropertyType . GetGenericArguments ( ) . Last ( ) ;
207
211
var pairs = token . Value < JObject > ( ) . Properties ( )
208
- . Select ( x => ( Key : x . Name , Values : x . Value . Value < JArray > ( ) . Select ( x => Parse ( x , valueType ) ) ) ) ;
212
+ . Select ( x => ( Key : x . Name , Values : x . Value . Value < JArray > ( ) . Select ( x => Parse ( x , valueType ) ) . Where ( x => ! x . IsNullOrWhiteSpace ( ) ) ) ) ;
209
213
210
214
if ( attribute . Separator == null )
211
215
{
0 commit comments