Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
Skip schema validation when value is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Mosoc committed May 14, 2019
1 parent 95fee4a commit cfd71ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/canner/src/hocs/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default function withValidation(Com: React.ComponentType<*>) {
if(checkSchema(schema)) {
promiseQueue.pop(_schemaValidation(schema, errorMessage)(value));
}
if(checkValidator(validator)) {
if(value && checkValidator(validator)) {
promiseQueue.pop(_customizedValidator(validator)(value));
}
}
Expand Down

0 comments on commit cfd71ef

Please sign in to comment.