Fix validation for empty emails

This commit is contained in:
Dmitriy Simushev 2015-03-17 13:25:00 +00:00
parent 6e78c45c67
commit 415005e2f6

View File

@ -77,6 +77,10 @@
// fully compatible with RFC 2822. See
// {@link https://github.com/chriso/validator.js/issues/377} for
// details. Thus we need a custom validation method for emails.
if (!email) {
return false;
}
var chunks = email.split('@');
if (chunks.length < 2) {