wix-incubator/accord

null BigDecimal validation throws NPE

avitaln opened this issue · 1 comments

this piece of code throw NullPointerException instead of returning a failure

case class Test(price: BigDecimal)
implicit val v = validator[Test] { _.price is notNull and >=[BigDecimal](0) }
validate(Test(null)).isFailure

(because the > is always calculated)

Confirmed. This is actually a little tricker to tackle than you'd expect, but I have a working (though seriously hack-y) solution ready. I'll try to find a cleaner way to deal with this and follow up in a few days.