Validator for optional field

Hello all together,

i am using Vaadin 8.1 and have a Problem. I am using an EmailValidator together with a Binding. But the validation should only occur, if the email is not empty (cause email is not required in my case). How can I do that?

Here’s my code:

                            .withValidator(new EmailValidator("Ungültige Email-Adresse"))
                            .bind(MyBean::getEmpfaengerEmail, MyBean::setEmpfaengerEmail);

        NativeButton btn = new NativeButton("submit");
        btn.addClickListener(e -> {
            MyBean dataBean = new MyBean(domain);
            try {
            } catch (ValidationException e1) {
      "Bitte korrigieren Sie die fehlerhaften Eingaben.");