Skip to content

Commit

Permalink
#74 Fallback to empty string in parseSubject
Browse files Browse the repository at this point in the history
  • Loading branch information
nickrussler committed Jun 18, 2024
1 parent 1e063f6 commit 0175207
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/mimeparser/MimeMessageConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,10 @@ public static String parseSubject(MimeMessage message) {
return ""; // fallback to empty subject
}

if (subject == null) {
subject = "";
}

// heuristically decoding of malformed encoded subjects (see https://stackoverflow.com/a/4725175)
if (subject.startsWith("=?") && subject.endsWith("?=") && subject.contains(" ")) {
try {
Expand Down

0 comments on commit 0175207

Please sign in to comment.