diff options
author | Justin Clark-Casey (justincc) | 2011-11-14 15:24:02 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-11-14 15:24:02 +0000 |
commit | 49ec85ae154a8062e6fcf8bad95ecc3b611e7812 (patch) | |
tree | 837fef3c9287b9875edb4afcda99abfa580dc05c /OpenSim/Region/CoreModules | |
parent | doh - correct build break (diff) | |
download | opensim-SC_OLD-49ec85ae154a8062e6fcf8bad95ecc3b611e7812.zip opensim-SC_OLD-49ec85ae154a8062e6fcf8bad95ecc3b611e7812.tar.gz opensim-SC_OLD-49ec85ae154a8062e6fcf8bad95ecc3b611e7812.tar.bz2 opensim-SC_OLD-49ec85ae154a8062e6fcf8bad95ecc3b611e7812.tar.xz |
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
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs | 3 |
1 files changed, 2 insertions, 1 deletions
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 | |||
225 | foreach (Scene scene in m_Scenes) | 225 | foreach (Scene scene in m_Scenes) |
226 | { | 226 | { |
227 | ScenePresence sp = scene.GetScenePresence(toAgentID); | 227 | ScenePresence sp = scene.GetScenePresence(toAgentID); |
228 | if(!sp.IsChildAgent) | 228 | if(sp != null && !sp.IsChildAgent) |
229 | { | 229 | { |
230 | scene.EventManager.TriggerIncomingInstantMessage(gim); | 230 | scene.EventManager.TriggerIncomingInstantMessage(gim); |
231 | successful = true; | 231 | successful = true; |
232 | } | 232 | } |
233 | } | 233 | } |
234 | |||
234 | if (!successful) | 235 | if (!successful) |
235 | { | 236 | { |
236 | // If the message can't be delivered to an agent, it | 237 | // If the message can't be delivered to an agent, it |