From 9af1295a4abdc2fe4e049086418f5f1100aea236 Mon Sep 17 00:00:00 2001 From: Tran Van Quyet Date: Wed, 25 Nov 2020 13:54:23 +0700 Subject: [PATCH] Update message trimmed validation to allow empty message --- src/main/modules/validator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/modules/validator.js b/src/main/modules/validator.js index c88e1ad..5b61dab 100644 --- a/src/main/modules/validator.js +++ b/src/main/modules/validator.js @@ -108,7 +108,7 @@ function validate_idShouldBeTrimmed(errors, id) { } function validate_messageShouldBeTrimmed(errors, msg) { - if (msg.trim() !== msg) { + if (msg.trim() !== msg && msg.trim() !== '') { errors.push(`Messages should not start or end with whitespaces`); } }