Skip to content

Commit

Permalink
Fixed fetching of PreviewText items if the body's ContentTransferEnco…
Browse files Browse the repository at this point in the history
…ding is NIL

Fixes issue #881
  • Loading branch information
jstedfast committed Jul 22, 2019
1 parent 4ade916 commit b42fc3c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion MailKit/Net/Imap/ImapFolderFetch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,10 @@ public override void Add (Section section)
var charset = body.ContentType.Charset;
ContentEncoding encoding;

MimeUtils.TryParse (body.ContentTransferEncoding, out encoding);
if (!string.IsNullOrEmpty (body.ContentTransferEncoding))
MimeUtils.TryParse (body.ContentTransferEncoding, out encoding);
else
encoding = ContentEncoding.Default;

using (var memory = new MemoryStream ()) {
var content = new MimeContent (section.Stream, encoding);
Expand Down

0 comments on commit b42fc3c

Please sign in to comment.