Skip to content

Commit

Permalink
StringMaxLengthConstraint returns true when string is empty. Closes #72.
Browse files Browse the repository at this point in the history
  • Loading branch information
hisystems committed Sep 24, 2012
1 parent a95119b commit 075ae48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Contraints/StringMaxLengthConstraint.cs
Expand Up @@ -33,7 +33,7 @@ public int MaxLength

public bool ValueSatisfiesConstraint(string value)
{
return !string.IsNullOrEmpty(value) && value.Length <= pintMaxLength;
return (value != null && value.Length <= pintMaxLength) || value == null;
}

public override string ToString()
Expand Down

0 comments on commit 075ae48

Please sign in to comment.