From 6b8fda098d2cc1ae5cca321e59c9a422e3d6a2d1 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 14 Jul 2018 16:11:03 +0100 Subject: [PATCH] recover lost null check in last commit --- .../CoreModules/World/Land/LandManagementModule.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index c32de62afc..09ece7d947 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -973,7 +973,7 @@ namespace OpenSim.Region.CoreModules.World.Land { try { - return m_landList[m_landIDList[x / 4, y / 4]]; + return m_landList[m_landIDList[x / LandUnit, y / LandUnit]]; } catch (IndexOutOfRangeException) { @@ -2044,7 +2044,13 @@ namespace OpenSim.Region.CoreModules.World.Land // 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