Prevent a nullref if a recipient of a group message gas left the scene

avinationmerge
Melanie 2009-11-15 20:21:46 +00:00
parent 28aa8010b2
commit b7f1fc116e
1 changed files with 14 additions and 11 deletions

View File

@ -164,19 +164,22 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
List<GridInstantMessage>msglist = SynchronousRestObjectPoster.BeginPostObject<UUID, List<GridInstantMessage>>(
"POST", m_RestURL+"/RetrieveMessages/", client.AgentId);
foreach (GridInstantMessage im in msglist)
if (msglist != null)
{
// client.SendInstantMessage(im);
foreach (GridInstantMessage im in msglist)
{
// client.SendInstantMessage(im);
// Send through scene event manager so all modules get a chance
// to look at this message before it gets delivered.
//
// Needed for proper state management for stored group
// invitations
//
Scene s = FindScene(client.AgentId);
if (s != null)
s.EventManager.TriggerIncomingInstantMessage(im);
// Send through scene event manager so all modules get a chance
// to look at this message before it gets delivered.
//
// Needed for proper state management for stored group
// invitations
//
Scene s = FindScene(client.AgentId);
if (s != null)
s.EventManager.TriggerIncomingInstantMessage(im);
}
}
}