Added a safety check for empty mail addys

This commit is contained in:
Rick Falkvinge
2015-12-01 19:46:04 +01:00
parent d48ed03024
commit 01b5ce0ec3
@@ -37,6 +37,11 @@ namespace Swarmops.Utility.Communications
// This is a rather simple mail (no images or stuff like that)
if (string.IsNullOrWhiteSpace (person.Mail))
{
throw new OutboundCommTransmitException("No valid mail address for " + person.Canonical);
}
try
{
mail.From = new MailAddress ((string) comm[CommRenderPart.SenderMail], (string) comm[CommRenderPart.SenderName],