From ae171b3ffb03dbb998cc8c24ce81d7e0bfd32e5e Mon Sep 17 00:00:00 2001 From: Jan Chaloupecky Date: Fri, 22 Apr 2022 14:24:20 +0200 Subject: [PATCH] Validate email address only when it's set --- assets/js/components/appointments_modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/components/appointments_modal.js b/assets/js/components/appointments_modal.js index d83c279a..a61709be 100755 --- a/assets/js/components/appointments_modal.js +++ b/assets/js/components/appointments_modal.js @@ -626,7 +626,7 @@ App.Components.AppointmentsModal = (function () { } // 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'); throw new Error(lang('invalid_email')); }