fixes null string usage

This commit is contained in:
2019-09-05 21:06:57 +01:00
parent ea5807d342
commit dafc52974a

View File

@ -27,17 +27,12 @@ namespace Yavsc.Attributes.Validation
public override bool IsValid(object value) {
if (value == null) {
return false;
}
string stringValue = value as string;
if (stringValue==null) return false;
if (stringValue==null) return MinimumLength <= 0;
if (MinimumLength>=0)
{
if (stringValue.Length< MinimumLength) {
return false;
}
}
if (maxLen>=0)