From bc604f906ea7ce2b3003b358015783279464ecce Mon Sep 17 00:00:00 2001 From: infinite-yy Date: Fri, 25 Aug 2017 10:11:14 +0800 Subject: [PATCH] fix a tiny error --- src/widgets/validate.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/widgets/validate.js b/src/widgets/validate.js index f559644..e5f253d 100644 --- a/src/widgets/validate.js +++ b/src/widgets/validate.js @@ -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); }