add some npe checks

master
Christopher 2020-07-01 18:48:25 +02:00
parent d98e706e26
commit 0821d12685
1 changed files with 10 additions and 3 deletions

View File

@ -282,9 +282,16 @@ namespace OpenSim.Modules.EMail
Email lslMessage = new Email(); Email lslMessage = new Email();
lslMessage.time = DateTime.Now.ToShortTimeString(); lslMessage.time = DateTime.Now.ToShortTimeString();
lslMessage.message = messages[0].Mail.TextBody.ToString();
lslMessage.sender = messages[0].Mail.Sender.GetAddress(true); if (messages[0].Mail.TextBody != null)
lslMessage.subject = messages[0].Mail.Subject; lslMessage.message = messages[0].Mail.TextBody.ToString();
if(messages[0].Mail.Sender != null)
lslMessage.sender = messages[0].Mail.Sender.GetAddress(true);
if (messages[0].Mail.Subject != null)
lslMessage.subject = messages[0].Mail.Subject;
lslMessage.numLeft = messages.Count - 1; lslMessage.numLeft = messages.Count - 1;
m_messages.Remove(messages[0]); m_messages.Remove(messages[0]);