From 01b5ce0ec3da9509634fc8aa660dc20f78576b94 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Tue, 1 Dec 2015 19:46:04 +0100 Subject: [PATCH] Added a safety check for empty mail addys --- Utility/Communications/CommsTransmitterMail.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Utility/Communications/CommsTransmitterMail.cs b/Utility/Communications/CommsTransmitterMail.cs index 438562ec..f1cef0c8 100644 --- a/Utility/Communications/CommsTransmitterMail.cs +++ b/Utility/Communications/CommsTransmitterMail.cs @@ -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],