Prevent crash

pull/170/head
M66B 5 years ago
parent 2ef0ab5357
commit 2a3c4e6b93

@ -348,7 +348,8 @@ public class MailService implements AutoCloseable {
} else
throw new NoSuchProviderException(protocol);
} catch (MessagingException ex) {
if (ex.getCause() instanceof SSLHandshakeException &&
if (factory != null &&
ex.getCause() instanceof SSLHandshakeException &&
ex.getCause().getCause() instanceof CertificateException)
throw new UntrustedException(factory.getFingerPrint(), ex);
else

Loading…
Cancel
Save