diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 4cb0bec6b4..e07834853e 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -110,10 +110,16 @@ namespace OpenSim.Region.Environment.Scenes { if (this.Avatars.ContainsKey(toAgentID)) { - // Local sim message - ScenePresence avatar = this.Avatars[toAgentID]; - - avatar.ControllingClient.SendInstantMessage(message, toAgentID); + if (this.Avatars.ContainsKey(fromAgentID)) + { + // Local sim message + ScenePresence avatar = this.Avatars[fromAgentID]; + avatar.ControllingClient.SendInstantMessage(message, toAgentID); + } + else + { + // Message came from a user outside the sim, ignore? + } } else {