Validate email address only when it's set

This commit is contained in:
Jan Chaloupecky 2022-04-22 14:24:20 +02:00
parent 227612565d
commit ae171b3ffb

View file

@ -626,7 +626,7 @@ App.Components.AppointmentsModal = (function () {
} }
// Check email address. // Check email address.
if (!App.Utils.Validation.email($appointmentsModal.find('#email').val())) { if ($appointmentsModal.find('#email').val() && !App.Utils.Validation.email($appointmentsModal.find('#email').val())) {
$appointmentsModal.find('#email').addClass('is-invalid'); $appointmentsModal.find('#email').addClass('is-invalid');
throw new Error(lang('invalid_email')); throw new Error(lang('invalid_email'));
} }