From ce5ecd1c1838d7195abf5a3e191fb10db8555e38 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 1 Jan 2020 13:39:31 +0530 Subject: [PATCH] fix: validate field only if value is set --- model/document.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/document.js b/model/document.js index 6cb5e816..51e9feb8 100644 --- a/model/document.js +++ b/model/document.js @@ -244,7 +244,7 @@ module.exports = class BaseDocument extends Observable { if (field.fieldtype == 'Select') { this.meta.validateSelect(field, value); } - if (field.validate) { + if (field.validate && value != null) { let validator = null; if (typeof field.validate === 'object') { validator = this.getValidateFunction(field.validate);