Skip to content

Commit

Permalink
Allow empty TextBody and HtmlBody properties for BodyBuilder
Browse files Browse the repository at this point in the history
Previously, setting these properties to string.Empty was
treated the same as setting them to null.

Fixes issue #391
  • Loading branch information
jstedfast committed Apr 12, 2018
1 parent 71fcc1a commit 9ead975
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MimeKit/BodyBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public MimeEntity ToMessageBody ()
MultipartAlternative alternative = null;
MimeEntity body = null;

if (!string.IsNullOrEmpty (TextBody)) {
if (TextBody != null) {
var text = new TextPart ("plain");
text.Text = TextBody;

Expand All @@ -139,7 +139,7 @@ public MimeEntity ToMessageBody ()
}
}

if (!string.IsNullOrEmpty (HtmlBody)) {
if (HtmlBody != null) {
var text = new TextPart ("html");
MimeEntity html;

Expand Down

0 comments on commit 9ead975

Please sign in to comment.