Skip to content

Commit

Permalink
Require non-null inputs to InlineImage.InlineImage(String, DataSource,
Browse files Browse the repository at this point in the history
MimeBodyPart)
  • Loading branch information
garydgregory committed Dec 15, 2023
1 parent 1a84a85 commit 0bd6c48
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/main/java/org/apache/commons/mail/HtmlEmail.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;

import javax.activation.DataHandler;
import javax.activation.DataSource;
Expand Down Expand Up @@ -97,14 +98,14 @@ private static final class InlineImage {
/**
* Creates an InlineImage object to represent the specified content ID and {@code MimeBodyPart}.
*
* @param cid the generated content ID
* @param dataSource the {@code DataSource} that represents the content
* @param mimeBodyPart the {@code MimeBodyPart} that contains the encoded data
* @param cid the generated content ID, not null.
* @param dataSource the {@code DataSource} that represents the content, not null.
* @param mimeBodyPart the {@code MimeBodyPart} that contains the encoded data, not null.
*/
private InlineImage(final String cid, final DataSource dataSource, final MimeBodyPart mimeBodyPart) {
this.cid = cid;
this.dataSource = dataSource;
this.mimeBodyPart = mimeBodyPart;
this.cid = Objects.requireNonNull(cid, "cid");
this.dataSource = Objects.requireNonNull(dataSource, "dataSource");
this.mimeBodyPart = Objects.requireNonNull(mimeBodyPart, "mimeBodyPart");
}

/**
Expand Down

0 comments on commit 0bd6c48

Please sign in to comment.