From 49ec85ae154a8062e6fcf8bad95ecc3b611e7812 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 14 Nov 2011 15:24:02 +0000 Subject: Do a ScenePresence null check in HGMessageTransferModule.SendIMToScene() to stop a NullReferenceException being thrown if an HG IM is sent to a simulator running multiple regions This is an attempt to address http://opensimulator.org/mantis/view.php?id=5791 --- .../CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules/Avatar/InstantMessage') diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs index 321a705..560d913 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs @@ -225,12 +225,13 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage foreach (Scene scene in m_Scenes) { ScenePresence sp = scene.GetScenePresence(toAgentID); - if(!sp.IsChildAgent) + if(sp != null && !sp.IsChildAgent) { scene.EventManager.TriggerIncomingInstantMessage(gim); successful = true; } } + if (!successful) { // If the message can't be delivered to an agent, it -- cgit v1.1