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
This commit is contained in:
Justin Clark-Casey (justincc)
2012-07-10 23:03:52 +01:00
parent f3134b5cf6
commit 58869e5aa0
3 changed files with 33 additions and 6 deletions

View File

@@ -4556,10 +4556,20 @@ namespace OpenSim.Region.Framework.Scenes
/// Get a copy of the list of sitting avatars.
/// </summary>
/// <remarks>This applies to all sitting avatars whether there is a sit target set or not.</remarks>
/// <returns></returns>
/// <returns>A hashset of the sitting avatars. Returns null if there are no sitting avatars.</returns>
public HashSet<UUID> GetSittingAvatars()
{
return new HashSet<UUID>(m_sittingAvatars);
HashSet<UUID> sittingAvatars = m_sittingAvatars;
if (sittingAvatars == null)
{
return null;
}
else
{
lock (sittingAvatars)
return new HashSet<UUID>(sittingAvatars);
}
}
/// <summary>