Skip to content

Commit

Permalink
Invert if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Kees committed Sep 11, 2023
1 parent e8a70b9 commit 7fd588f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions MsgReaderCore/Mime/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,9 @@ private MailMessage ToMailMessage()
};

attachment.Name = string.IsNullOrEmpty(attachment.Name) ? attachmentMessagePart.FileName : attachment.Name;
if (attachment.ContentDisposition != null)
attachment.ContentDisposition.FileName = string.IsNullOrEmpty(attachment.ContentDisposition.FileName)
? attachmentMessagePart.FileName
: attachment.ContentDisposition.FileName;
attachment.ContentDisposition.FileName = string.IsNullOrEmpty(attachment.ContentDisposition.FileName)
? attachmentMessagePart.FileName
: attachment.ContentDisposition.FileName;

message.Attachments.Add(attachment);
}
Expand Down Expand Up @@ -513,13 +512,13 @@ public void Save(Stream messageStream)

if (_changed)
{
messageStream.Write(RawMessage, 0, RawMessage.Length);
Logger.WriteToLog("Raw EML message saved");
ToMailMessage().WriteTo(messageStream);
Logger.WriteToLog("EML message saved as new message");
}
else
{
ToMailMessage().WriteTo(messageStream);
Logger.WriteToLog("EML message saved as new message");
messageStream.Write(RawMessage, 0, RawMessage.Length);
Logger.WriteToLog("Raw EML message saved");
}
}
#endregion
Expand Down

0 comments on commit 7fd588f

Please sign in to comment.