Permalink
Browse files

Minor Bugfix SetAddressFields

Deal with malformed "From" and "Sender" header fields
  • Loading branch information...
smiley22 committed Sep 22, 2012
1 parent 9f15de4 commit d56ab6dc3e1fc3bfc4acca4b81b0fef91d828094
Showing with 7 additions and 4 deletions.
  1. +3 −2 .gitignore
  2. +4 −2 MessageBuilder.cs
View
@@ -1,5 +1,6 @@
-# Ignore Sandcastle documentation directory
-Documentation/
+# Ignore nuspec files from NuGet
+*.nuspec
+Tools/
#################
## Eclipse
View
@@ -179,11 +179,13 @@ internal static class MessageBuilder {
}
if (header["From"] != null) {
addr = ParseAddressList(header["From"]);
- m.From = new MailAddress(addr.Length > 0 ? addr[0] : "");
+ if(addr.Length > 0)
+ m.From = new MailAddress(addr[0]);
}
if (header["Sender"] != null) {
addr = ParseAddressList(header["Sender"]);
- m.Sender = new MailAddress(addr.Length > 0 ? addr[0] : "");
+ if(addr.Length > 0)
+ m.Sender = new MailAddress(addr[0]);
}
if (header["Reply-to"] != null) {
addr = ParseAddressList(header["Reply-to"]);

0 comments on commit d56ab6d

Please sign in to comment.