noir-clojure / lib-noir

A set of libraries for ring apps, including stateful sessions.
Eclipse Public License 1.0
483 stars 47 forks source link

return false from is-email? when input is nil #98

Closed JuneKelly closed 10 years ago

JuneKelly commented 10 years ago

Previous behaviour was to allow the call to matches-regex? to raise an exception when the input value was nil. This causes problems when using noir.validation to validate inputs to (for example) a restful service, where it is possible for the client to omit fields from the input data.

See: https://github.com/noir-clojure/lib-noir/issues/97

Tests have been updated to cover both nil and empty string as inputs to the is-email? function. All test passing

yogthos commented 10 years ago

The change makes sense to me, thanks.

yogthos commented 10 years ago

I've pushed out 0.8.1 with the change.