Log error when Recipient emailMessage.Recipients is null (#7685)

This commit is contained in:
Julián Alazorza 2017-05-12 18:05:27 +02:00 committed by Sébastien Ros
parent 285857037c
commit 6ea2b8c7f4

View File

@ -57,7 +57,7 @@ namespace Orchard.Email.Services {
Attachments = (IEnumerable<string>)(parameters.ContainsKey("Attachments") ? parameters["Attachments"] : new List<string>()) Attachments = (IEnumerable<string>)(parameters.ContainsKey("Attachments") ? parameters["Attachments"] : new List<string>())
}; };
if (emailMessage.Recipients.Length == 0) { if (string.IsNullOrWhiteSpace(emailMessage.Recipients)) {
Logger.Error("Email message doesn't have any recipient"); Logger.Error("Email message doesn't have any recipient");
return; return;
} }
@ -177,4 +177,4 @@ namespace Orchard.Email.Services {
return recipients.Split(new[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries); return recipients.Split(new[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries);
} }
} }
} }