add some error handling
parent
affd6cbeb3
commit
8295c88818
|
@ -257,23 +257,38 @@ namespace OpenSim.Modules.EMail
|
|||
public Email GetNextEmail(UUID objectID, string sender, string subject)
|
||||
{
|
||||
SceneObjectPart sceneObject = m_scene.GetSceneObjectPart(objectID);
|
||||
m_log.Info("[" + Name + "] GetNextEmail: " + sceneObject.Name + " (" + sceneObject.UUID + ")");
|
||||
|
||||
if(sceneObject != null)
|
||||
{
|
||||
List<InternalMail> messages = m_messages.FindAll(X => X.ID == objectID);
|
||||
if (messages.Count == 0)
|
||||
return null;
|
||||
|
||||
if(messages[0] != null)
|
||||
{
|
||||
Email lslMessage = new Email();
|
||||
|
||||
lslMessage.time = messages[0].Mail.Date.ToUnixTimeSeconds().ToString();
|
||||
lslMessage.message = messages[0].Mail.Body.ToString();
|
||||
lslMessage.message = messages[0].Mail.TextBody.ToString();
|
||||
lslMessage.sender = messages[0].Mail.Sender.GetAddress(true);
|
||||
lslMessage.subject = messages[0].Mail.Subject;
|
||||
lslMessage.numLeft = messages.Count - 1;
|
||||
|
||||
m_messages.Remove(messages[0]);
|
||||
|
||||
return lslMessage;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Error("[" + Name + "] Cant find caller objekt!");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Error("[" + Name + "] Cant find caller objekt!");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public bool isUUID(string thing)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue