Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow phoneUS rule to pass when observable value is null #234

Closed
wants to merge 2 commits into from

Conversation

JoeDoyle23
Copy link

We ran into a situation where we had a non-required phone number that we wanted validated, but the source value was null instead of an empty string. This caused the type check on line 620 to fail and the validation to then fail.

The change is to simply check for null first, then the type of the value.

A test was added to the suite as well.

Joe Doyle added 2 commits February 25, 2013 11:58
The type check in the phoneUS rule is too specific and validation fails
if the value is null.  Added fix and unit test.
@stevegreatrex
Copy link
Contributor

This makes sense - if the field is mandatory then you could add a required as well.

@stevegreatrex
Copy link
Contributor

Fixed by #279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants