Skip to content

Commit

Permalink
improve null safety of amazon subject obfuscation
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenMassaro committed Dec 22, 2023
1 parent b1c0776 commit 97d0e78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.massaro</groupId>
<artifactId>Email</artifactId>
<version>2.9.5</version>
<version>2.9.6</version>

<parent>
<groupId>org.springframework.boot</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/email/model/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public Message(javax.mail.Message message,
this.fromAddress = sender.getAddress();
this.fromPersonal = sender.getPersonal();
}
if (obfuscateAmazonOrderSubject && (this.fromAddress.equalsIgnoreCase("shipment-tracking@amazon.com") || this.subject.toLowerCase().contains("your amazon.com order of \""))) {
if (obfuscateAmazonOrderSubject && ("shipment-tracking@amazon.com".equalsIgnoreCase(this.fromAddress) || (this.subject != null && this.subject.toLowerCase().contains("your amazon.com order of \"")))) {
this.subject = subject.replaceAll("\"(.*?)\"", "*****");
}
javax.mail.Address[] recipients = message.getRecipients(javax.mail.Message.RecipientType.TO);
Expand Down

0 comments on commit 97d0e78

Please sign in to comment.