From 52dd6833260720ada5681df337bb549725dea6c5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 19 May 2017 18:03:02 +0100 Subject: fix a null ref on parcels join --- .../Region/CoreModules/World/Land/LandManagementModule.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 057e204..a2c7c83 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -679,6 +679,7 @@ namespace OpenSim.Region.CoreModules.World.Land public void removeLandObject(int local_id) { ILandObject land; + UUID landGlobalID = UUID.Zero; lock (m_landList) { for (int x = 0; x < m_landIDList.GetLength(0); x++) @@ -697,12 +698,18 @@ namespace OpenSim.Region.CoreModules.World.Land land = m_landList[local_id]; m_landList.Remove(local_id); - if(land.LandData != null) - m_landUUIDList.Remove(land.LandData.GlobalID); - land.Clear(); + if(land != null && land.LandData != null) + { + landGlobalID = land.LandData.GlobalID; + m_landUUIDList.Remove(landGlobalID); + } } - m_scene.EventManager.TriggerLandObjectRemoved(land.LandData.GlobalID); + if(landGlobalID != UUID.Zero) + { + m_scene.EventManager.TriggerLandObjectRemoved(landGlobalID); + land.Clear(); + } } /// -- cgit v1.1