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

Validating a null property will cause an error #69

Closed
lucapinelli opened this issue Mar 18, 2019 · 1 comment
Closed

Validating a null property will cause an error #69

lucapinelli opened this issue Mar 18, 2019 · 1 comment

Comments

@lucapinelli
Copy link

Validating a null property will cause an error, e.g.:

const { Validator, Rule } = require('@cesium133/forgjs');


let validator = new Validator({
    name: new Rule({ type: 'string', optional: false, notEmpty: true, minLength: 1 }),
});

// this will works
validator.test({ name: 'ok' }); // return true


// this will throw an exception
validator.test({ name: null }); // this throw an Error
@XX-NF-XX
Copy link
Contributor

This is the same issue as #66
PR #67 should resolve both

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

No branches or pull requests

3 participants