diff --git a/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs b/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs index 1311fd3812..68e8fcf438 100644 --- a/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs @@ -763,11 +763,25 @@ namespace OpenSim.Region.Environment.Modules.LandManagement foreach (SceneObjectGroup obj in primsOverMe) { - if (!ownersAndCount.ContainsKey(obj.OwnerID)) + try { - ownersAndCount.Add(obj.OwnerID, 0); + if (!ownersAndCount.ContainsKey(obj.OwnerID)) + { + ownersAndCount.Add(obj.OwnerID, 0); + } + } + catch (NullReferenceException) + { + m_log.Info("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel"); + } + try + { + ownersAndCount[obj.OwnerID] += obj.PrimCount; + } + catch (KeyNotFoundException) + { + m_log.Error("[LAND]: Unable to match a prim with it's owner."); } - ownersAndCount[obj.OwnerID] += obj.PrimCount; } if (ownersAndCount.Count > 0) { diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 1e63ae7925..28758747d7 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -161,7 +161,14 @@ namespace OpenSim.Region.Environment.Scenes public override uint LocalId { - get { return m_rootPart.LocalId; } + get { + if (m_rootPart == null) + { + m_log.Error("[PRIMGROUP]: Unable to find the rootpart for a LocalId Request!"); + return 0; + } + + return m_rootPart.LocalId; } set { m_rootPart.LocalId = value; } } @@ -173,7 +180,12 @@ namespace OpenSim.Region.Environment.Scenes public LLUUID OwnerID { - get { return m_rootPart.OwnerID; } + get { + if (m_rootPart == null) + return LLUUID.Zero; + + return m_rootPart.OwnerID; + } set { m_rootPart.OwnerID = value; } }