From 107cef2b0e176a586ef81e3ada1cc3c1641c5467 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Fri, 3 Feb 2012 15:18:48 -0800 Subject: Check for null scene in ScheduleFullUpdate and ScheduleTerseUpdate before triggering events on a potentially null Scene --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 9b660b6..0e899ca 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2729,8 +2729,6 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup == null) return; - ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); - ParentGroup.QueueForUpdateCheck(); int timeNow = Util.UnixTimeSinceEpoch(); @@ -2752,6 +2750,9 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat( // "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", // UUID, Name, TimeStampFull); + + if (ParentGroup.Scene != null) + ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); } /// @@ -2763,13 +2764,12 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup == null) return; - ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); - // This was pulled from SceneViewer. Attachments always receive full updates. // I could not verify if this is a requirement but this maintains existing behavior if (ParentGroup.IsAttachment) { ScheduleFullUpdate(); + return; } if (UpdateFlag == UpdateRequired.NONE) @@ -2784,6 +2784,9 @@ namespace OpenSim.Region.Framework.Scenes // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", // UUID, Name, TimeStampTerse); } + + if (ParentGroup.Scene != null) + ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); } public void ScriptSetPhysicsStatus(bool UsePhysics) -- cgit v1.1