aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMakopoppo2011-08-27 12:16:46 +0900
committerBlueWall2011-08-27 07:45:02 -0400
commit795b56e695976575eacfd5505830a94f32ca2d28 (patch)
tree0bac35fd90ac11c938be63a4b33ca2adab67f129 /OpenSim
parentStop avatars returning from neighbouring regions from stalling on the border ... (diff)
downloadopensim-SC_OLD-795b56e695976575eacfd5505830a94f32ca2d28.zip
opensim-SC_OLD-795b56e695976575eacfd5505830a94f32ca2d28.tar.gz
opensim-SC_OLD-795b56e695976575eacfd5505830a94f32ca2d28.tar.bz2
opensim-SC_OLD-795b56e695976575eacfd5505830a94f32ca2d28.tar.xz
Related to #4689 - Adding missing null check for SceneObjectPart
Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs14
2 files changed, 18 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 9358e7b..addc20c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -223,6 +223,8 @@ namespace OpenSim.Region.Framework.Scenes
223 223
224 // Retrieve group 224 // Retrieve group
225 SceneObjectPart part = GetSceneObjectPart(primId); 225 SceneObjectPart part = GetSceneObjectPart(primId);
226 if (part == null)
227 return new ArrayList();
226 SceneObjectGroup group = part.ParentGroup; 228 SceneObjectGroup group = part.ParentGroup;
227 if (null == group) 229 if (null == group)
228 { 230 {
@@ -967,6 +969,8 @@ namespace OpenSim.Region.Framework.Scenes
967 public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID) 969 public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID)
968 { 970 {
969 SceneObjectPart part = GetSceneObjectPart(localID); 971 SceneObjectPart part = GetSceneObjectPart(localID);
972 if (part == null)
973 return;
970 SceneObjectGroup group = part.ParentGroup; 974 SceneObjectGroup group = part.ParentGroup;
971 if (group != null) 975 if (group != null)
972 { 976 {
@@ -2028,6 +2032,8 @@ namespace OpenSim.Region.Framework.Scenes
2028 foreach (uint localID in localIDs) 2032 foreach (uint localID in localIDs)
2029 { 2033 {
2030 SceneObjectPart part = GetSceneObjectPart(localID); 2034 SceneObjectPart part = GetSceneObjectPart(localID);
2035 if (part == null)
2036 continue;
2031 if (!groups.Contains(part.ParentGroup)) 2037 if (!groups.Contains(part.ParentGroup))
2032 groups.Add(part.ParentGroup); 2038 groups.Add(part.ParentGroup);
2033 } 2039 }
@@ -2073,6 +2079,8 @@ namespace OpenSim.Region.Framework.Scenes
2073 foreach (uint localID in localIDs) 2079 foreach (uint localID in localIDs)
2074 { 2080 {
2075 SceneObjectPart part = GetSceneObjectPart(localID); 2081 SceneObjectPart part = GetSceneObjectPart(localID);
2082 if (part == null)
2083 continue;
2076 part.GetProperties(remoteClient); 2084 part.GetProperties(remoteClient);
2077 } 2085 }
2078 } 2086 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index f40b373..0582586 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1546,8 +1546,11 @@ namespace OpenSim.Region.Framework.Scenes
1546 if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId)) 1546 if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
1547 { 1547 {
1548 SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID); 1548 SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID);
1549 part.ClickAction = Convert.ToByte(clickAction); 1549 if (part != null)
1550 group.HasGroupChanged = true; 1550 {
1551 part.ClickAction = Convert.ToByte(clickAction);
1552 group.HasGroupChanged = true;
1553 }
1551 } 1554 }
1552 } 1555 }
1553 } 1556 }
@@ -1560,8 +1563,11 @@ namespace OpenSim.Region.Framework.Scenes
1560 if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId)) 1563 if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
1561 { 1564 {
1562 SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID); 1565 SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID);
1563 part.Material = Convert.ToByte(material); 1566 if (part != null)
1564 group.HasGroupChanged = true; 1567 {
1568 part.Material = Convert.ToByte(material);
1569 group.HasGroupChanged = true;
1570 }
1565 } 1571 }
1566 } 1572 }
1567 } 1573 }