From b7f1fc116eb37a651a80bc09df11fa47540a1df9 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 15 Nov 2009 20:21:46 +0000 Subject: Prevent a nullref if a recipient of a group message gas left the scene --- .../Avatar/InstantMessage/OfflineMessageModule.cs | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 1614b70..7f9e5af 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs @@ -164,19 +164,22 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage Listmsglist = SynchronousRestObjectPoster.BeginPostObject>( "POST", m_RestURL+"/RetrieveMessages/", client.AgentId); - foreach (GridInstantMessage im in msglist) + if (msglist != null) { - // 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); + 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); + } } } -- cgit v1.1