commons-email icon indicating copy to clipboard operation
commons-email copied to clipboard

EMAIL-184: Should throw EmailException if email provided is null

Open saksham93 opened this issue 5 years ago • 4 comments

Should throw EmailException if email provided is null. Right now NPE is being encountered.

(https://issues.apache.org/jira/projects/EMAIL/issues/EMAIL-184)

saksham93 avatar Jul 27 '19 13:07 saksham93

@markt-asf can you please help me. I am not able to understand the reason for which the build is failing

saksham93 avatar Jul 27 '19 14:07 saksham93

@michael-o Can you please check if this PR looks good to you? Thank you.

saksham93 avatar Dec 26 '19 17:12 saksham93

I am not fully convinced here. What happens with your patch when you provide null for mail?

michael-o avatar Dec 26 '19 18:12 michael-o

If some of the argument must not be blank/null, it should be handled by classes like this: https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/Validate.html

The method contract should precisely describe when null is allowed and when not.

michael-o avatar Dec 26 '19 18:12 michael-o

Closing, no reply, and no unit test.

garydgregory avatar Dec 10 '23 14:12 garydgregory