Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with empty Email address criteria #335

Closed
Romixery opened this issue Aug 22, 2021 · 4 comments
Closed

Issue with empty Email address criteria #335

Romixery opened this issue Aug 22, 2021 · 4 comments

Comments

@Romixery
Copy link

Romixery commented Aug 22, 2021

Hi,
Using version 6.6.1, I got an error when I used clearEmailAddressCriteria.
The error message: argument was assumed nonNull, but was null

The configuration I used:

MailerBuilder
                .withSMTPServer(SERVER_ADDRESS, SERVER_PORT, SERVER_USERNAME, SERVER_PASSWORD)
                .withTransportStrategy(TransportStrategy.SMTP)
                .withSessionTimeout(10 * 1000)
                .clearEmailAddressCriteria() 
                .withDebugLogging(true)
                .buildMailer();

Does anyone know how to fix it or do I have to wait for the bug fix? I investigated through the stack trace and found assumeNotNull checks for empty() of a collection too, so checking every empty collection will cause raise this error.
Thanks.

@bbottema
Copy link
Owner

Can you provide the full stacktrace please.

@Romixery
Copy link
Author

Sure,

Caused by: java.lang.IllegalArgumentException: argument was assumed nonNull, but was null
	at org.simplejavamail.internal.util.Preconditions.verifyNonnull(Preconditions.java:41) ~[core-module-6.6.1.jar:na]
	at org.simplejavamail.internal.util.Preconditions.assumeNonNull(Preconditions.java:35) ~[core-module-6.6.1.jar:na]
	at org.simplejavamail.mailer.internal.MailerGenericBuilderImpl.buildEmailGovernance(MailerGenericBuilderImpl.java:295) ~[simple-java-mail-6.6.1.jar:na]
	at org.simplejavamail.mailer.internal.MailerImpl.<init>(MailerImpl.java:122) ~[simple-java-mail-6.6.1.jar:na]
	at org.simplejavamail.mailer.internal.MailerRegularBuilderImpl.buildMailer(MailerRegularBuilderImpl.java:209) ~[simple-java-mail-6.6.1.jar:na]

@bbottema
Copy link
Owner

bbottema commented Aug 23, 2021

This is fixed in #319, but hasn't been released yet (it's part of a bigger release).

I think this bug appeared in version 6.6.0, so you could try 6.5.4. Unless you work with S/MIME, you won't miss much. That or use the most lenient rules for address validation...

@bbottema bbottema added this to the 7.0.0 milestone Aug 23, 2021
bbottema added a commit that referenced this issue Dec 25, 2021
…(which is a valid state for email address criteria)
@bbottema
Copy link
Owner

I decided to tackle this in a patch release and it actually revealed another bug that caused this. Fix just released in 6.7.3

@bbottema bbottema modified the milestones: 7.0.0, 6.7.3 Dec 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants