Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Put some null testing in BindHelpers

  • Loading branch information...
commit ce4bf6f1a5d1c8c71001e24ca537c5800ac7c541 1 parent b925803
@dpp dpp authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 core/util/src/main/scala/net/liftweb/util/BindHelpers.scala
View
9 core/util/src/main/scala/net/liftweb/util/BindHelpers.scala
@@ -1412,7 +1412,8 @@ final class ToCssBindPromoter(stringSelector: Box[String], css: Box[CssSelector]
* Inserts a String constant according to the CssSelector rules
*/
def #>(str: String): CssSel = new CssBindImpl(stringSelector, css) {
- def calculate(in: NodeSeq): Seq[NodeSeq] = List(Text(str))
+ def calculate(in: NodeSeq): Seq[NodeSeq] =
+ List(if (null eq str) NodeSeq.Empty else Text(str))
}
/**
@@ -1442,7 +1443,8 @@ final class ToCssBindPromoter(stringSelector: Box[String], css: Box[CssSelector]
* StringPromotable includes Int, Long, Boolean, and Symbol
*/
def #>(strPromo: StringPromotable): CssSel = new CssBindImpl(stringSelector, css) {
- def calculate(in: NodeSeq): Seq[NodeSeq] = List(Text(strPromo.toString))
+ def calculate(in: NodeSeq): Seq[NodeSeq] =
+ List(Text(strPromo.toString))
}
/**
@@ -1470,7 +1472,8 @@ final class ToCssBindPromoter(stringSelector: Box[String], css: Box[CssSelector]
* Inserts a String constant according to the CssSelector rules
*/
def replaceWith(str: String): CssSel = new CssBindImpl(stringSelector, css) {
- def calculate(in: NodeSeq): Seq[NodeSeq] = List(Text(str))
+ def calculate(in: NodeSeq): Seq[NodeSeq] =
+ List(if (null eq str) NodeSeq.Empty else Text(str))
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.