Skip to content

Commit

Permalink
Closes #1057. valMaxLen accepts null entries
Browse files Browse the repository at this point in the history
  • Loading branch information
dpp committed Jul 6, 2011
1 parent c973f08 commit 7cc7134
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/util/src/main/scala/net/liftweb/util/BaseField.scala
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ trait StringValidators {
*/
def valMaxLen(len: Int, msg: => String)(value: ValueType): List[FieldError] =
valueTypeToBoxString(value) match {
case Full(str) if (null ne str) && str.length <= len => Nil
case Full(str) if (null eq str) || str.length <= len => Nil
case _ => List(FieldError(this, Text(msg)))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ trait AbstractScreen extends Factory {
*/
protected def valMaxLen(len: => Int, msg: => String): String => List[FieldError] =
s => s match {
case str if (null ne str) && str.length <= len => Nil
case str if (null eq str) || str.length <= len => Nil
case _ => List(FieldError(currentField.box openOr new FieldIdentifier {}, Text(msg)))
}

Expand Down

0 comments on commit 7cc7134

Please sign in to comment.