From 44fd5bb7b5f7cab111ffc3ddbc3182b451799fad Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 28 Apr 2018 12:43:06 +0100 Subject: [PATCH] mantis 8321: avoid null reference potencial caused by outdated LMs for example --- .../CoreModules/World/Land/LandManagementModule.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 95b1af90ba..b1f5122598 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -2036,18 +2036,25 @@ namespace OpenSim.Region.CoreModules.World.Land { UUID parcel = UUID.Zero; UUID.TryParse(id, out parcel); + // assume we've got the parcelID we just computed in RemoteParcelRequest ExtendedLandData extLandData = new ExtendedLandData(); if(!Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle, out extLandData.X, out extLandData.Y)) return null; - m_log.DebugFormat("[LAND MANAGEMENT MODULE]: Got parcelinfo request for regionHandle {0}, x/y {1}/{2}", + m_log.DebugFormat("[LAND MANAGEMENT MODULE] : Got parcelinfo request for regionHandle {0}, x/y {1}/{2}", extLandData.RegionHandle, extLandData.X, extLandData.Y); // for this region or for somewhere else? if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle) { - extLandData.LandData = this.GetLandObject(extLandData.X, extLandData.Y).LandData; + ILandObject extLandObject = this.GetLandObject(extLandData.X, extLandData.Y); + if(extLandObject == null) + { + m_log.DebugFormat("[LAND MANAGEMENT MODULE]: ParcelInfoRequest: a FakeParcelID points to outside the region"); + return null; + } + extLandData.LandData = extLandObject.LandData; extLandData.RegionAccess = m_scene.RegionInfo.AccessLevel; } else