diff options
author | Justin Clark-Casey (justincc) | 2012-07-10 23:03:52 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-10 23:03:52 +0100 |
commit | 58869e5aa09a292dc2159c73bada2c487151dda0 (patch) | |
tree | bcd9d98aea384e8c065d347aeb26e6fee3cf07e5 /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |
parent | When an attachment is detached to inv or derezzed, stop the scripts, update t... (diff) | |
download | opensim-SC_OLD-58869e5aa09a292dc2159c73bada2c487151dda0.zip opensim-SC_OLD-58869e5aa09a292dc2159c73bada2c487151dda0.tar.gz opensim-SC_OLD-58869e5aa09a292dc2159c73bada2c487151dda0.tar.bz2 opensim-SC_OLD-58869e5aa09a292dc2159c73bada2c487151dda0.tar.xz |
Fix recent SOP.GetSittingAvatars() to return null if there are no sitting avatars rather than throwing an exception.
Extends sitting avatar regression tests to test new sitters information
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 6518b84..6677dae 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -4556,10 +4556,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
4556 | /// Get a copy of the list of sitting avatars. | 4556 | /// Get a copy of the list of sitting avatars. |
4557 | /// </summary> | 4557 | /// </summary> |
4558 | /// <remarks>This applies to all sitting avatars whether there is a sit target set or not.</remarks> | 4558 | /// <remarks>This applies to all sitting avatars whether there is a sit target set or not.</remarks> |
4559 | /// <returns></returns> | 4559 | /// <returns>A hashset of the sitting avatars. Returns null if there are no sitting avatars.</returns> |
4560 | public HashSet<UUID> GetSittingAvatars() | 4560 | public HashSet<UUID> GetSittingAvatars() |
4561 | { | 4561 | { |
4562 | return new HashSet<UUID>(m_sittingAvatars); | 4562 | HashSet<UUID> sittingAvatars = m_sittingAvatars; |
4563 | |||
4564 | if (sittingAvatars == null) | ||
4565 | { | ||
4566 | return null; | ||
4567 | } | ||
4568 | else | ||
4569 | { | ||
4570 | lock (sittingAvatars) | ||
4571 | return new HashSet<UUID>(sittingAvatars); | ||
4572 | } | ||
4563 | } | 4573 | } |
4564 | 4574 | ||
4565 | /// <summary> | 4575 | /// <summary> |