mantis 8321: avoid null reference potencial caused by outdated LMs for example

0.9.0.1-postfixes
UbitUmarov 2018-04-28 12:43:06 +01:00
parent 4958425e37
commit 44fd5bb7b5
1 changed files with 9 additions and 2 deletions

View File

@ -2036,6 +2036,7 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
UUID parcel = UUID.Zero; UUID parcel = UUID.Zero;
UUID.TryParse(id, out parcel); UUID.TryParse(id, out parcel);
// assume we've got the parcelID we just computed in RemoteParcelRequest // assume we've got the parcelID we just computed in RemoteParcelRequest
ExtendedLandData extLandData = new ExtendedLandData(); ExtendedLandData extLandData = new ExtendedLandData();
if(!Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle, if(!Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle,
@ -2047,7 +2048,13 @@ namespace OpenSim.Region.CoreModules.World.Land
// for this region or for somewhere else? // for this region or for somewhere else?
if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle) 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; extLandData.RegionAccess = m_scene.RegionInfo.AccessLevel;
} }
else else