Skip to content

Commit

Permalink
fix a tiny error
Browse files Browse the repository at this point in the history
  • Loading branch information
infinite-yy committed Aug 25, 2017
1 parent 90ae852 commit bc604f9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/widgets/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ export function validateInput(target, key, descriptor) {
const method = descriptor.initializer;
descriptor.initializer = function () {
return function (event) {
this.props.validators.map((validator, index) => {
check.apply(this, [validator, this.props.errorMessages[index], event.target.value]);
});
if(this.props.validators){
this.props.validators.map((validator, index) => {
check.apply(this, [validator, this.props.errorMessages[index], event.target.value]);
});
}

this._value = event.target.value;
method.apply(this)(event);
}
Expand Down

0 comments on commit bc604f9

Please sign in to comment.