From cde42cdbfd6744aca4468b0b09cccb4becaf200e Mon Sep 17 00:00:00 2001 From: mingchen Date: Sat, 7 Jun 2008 17:48:45 +0000 Subject: Potential Fix #1 for 0001392: Shift+Drag now causes an unhandled 'Object reference not set to an instance of object' exception --- .../Environment/Modules/World/Land/LandManagementModule.cs | 12 +++++++++--- OpenSim/Region/Environment/Scenes/InnerScene.cs | 1 - 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 29e3143..1c04796 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs @@ -583,11 +583,17 @@ namespace OpenSim.Region.Environment.Modules.World.Land public void UpdateLandPrimCounts() { ResetAllLandPrimCounts(); - foreach (EntityBase obj in m_scene.Entities.Values) + lock (m_scene.Entities) { - if (obj is SceneObjectGroup) + foreach (EntityBase obj in m_scene.Entities.Values) { - m_scene.EventManager.TriggerParcelPrimCountAdd((SceneObjectGroup)obj); + if (obj != null) + { + if (obj is SceneObjectGroup) + { + m_scene.EventManager.TriggerParcelPrimCountAdd((SceneObjectGroup)obj); + } + } } } FinalizeLandPrimCountUpdate(); diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 589d642..f04ce7f 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -234,7 +234,6 @@ namespace OpenSim.Region.Environment.Scenes { if (Entities.ContainsKey(uuid)) { - Console.WriteLine("REMOVED " + ((SceneObjectGroup)Entities[uuid]).Children.Count + "!"); if (!resultOfObjectLinked) { m_numPrim -= ((SceneObjectGroup)Entities[uuid]).Children.Count; -- cgit v1.1