Skip to content

Commit 245a871

Browse files
committed
- moved the check from arguments to sanatizedStrings in order to really ignore nulls in argument lists
1 parent 2ab1a0b commit 245a871

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

VerbalExpressions/VerbalExpressions.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public VerbalExpressions Range(params object[] arguments)
253253
throw new ArgumentNullException("arguments");
254254
}
255255

256-
if (arguments.Length == 1 || arguments.Length > 3)
256+
if (arguments.Length == 1)
257257
{
258258
throw new ArgumentOutOfRangeException("arguments");
259259
}
@@ -280,6 +280,11 @@ public VerbalExpressions Range(params object[] arguments)
280280
.OrderBy(s => s)
281281
.ToArray();
282282

283+
if (sanitizedStrings.Length > 3)
284+
{
285+
throw new ArgumentOutOfRangeException("arguments");
286+
}
287+
283288
if (!sanitizedStrings.Any())
284289
{
285290
return this;

0 commit comments

Comments
 (0)