From a30ad71651cb49720bf8b04e2d651bd28f5b8ea2 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 25 Mar 2014 03:17:44 +0100 Subject: Guard against Scene being null in attachments it the wearing avatar is in the process of logging out. --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 3e1dcaa..86f60bb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1886,25 +1886,27 @@ namespace OpenSim.Region.Framework.Scenes { SceneObjectPart part = parts[i]; - Scene.ForEachRootScenePresence(delegate(ScenePresence avatar) + if (Scene != null) { - if (avatar.ParentID == LocalId) - avatar.StandUp(); - - if (!silent) + Scene.ForEachRootScenePresence(delegate(ScenePresence avatar) { - part.ClearUpdateSchedule(); - if (part == m_rootPart) + if (avatar.ParentID == LocalId) + avatar.StandUp(); + + if (!silent) { - if (!IsAttachment - || AttachedAvatar == avatar.ControllingClient.AgentId - || !HasPrivateAttachmentPoint) - avatar.ControllingClient.SendKillObject(m_regionHandle, new List { part.LocalId }); + part.ClearUpdateSchedule(); + if (part == m_rootPart) + { + if (!IsAttachment + || AttachedAvatar == avatar.ControllingClient.AgentId + || !HasPrivateAttachmentPoint) + avatar.ControllingClient.SendKillObject(m_regionHandle, new List { part.LocalId }); + } } - } - }); + }); + } } - } public void AddScriptLPS(int count) -- cgit v1.1