From f82227a1865e95ebc86a43c732bfd77ef97d3814 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 23 Mar 2008 07:10:04 +0000 Subject: * Added a little more stability for getting the object list from the parcel box. (previously it crashed my simulator) * Found and gracefully handled a few situations where null references occur. (m_rootPart again!) --- .../Environment/Modules/LandManagement/LandObject.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Environment/Modules') diff --git a/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs b/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs index 1311fd3..68e8fcf 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 + { + 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) { - ownersAndCount.Add(obj.OwnerID, 0); + m_log.Error("[LAND]: Unable to match a prim with it's owner."); } - ownersAndCount[obj.OwnerID] += obj.PrimCount; } if (ownersAndCount.Count > 0) { -- cgit v1.1