From 2e288fade12aba07456550fb215a53ec4a630599 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Mon, 15 Dec 2008 18:11:47 +0000
Subject: * minor: Stop presence child status suffering an NRE if the agent
uuid given is not represent at all
---
OpenSim/Framework/IScene.cs | 10 +++++++++-
OpenSim/Region/Environment/Scenes/Scene.cs | 11 +++++------
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs
index 63bf7ac..6a6fdf1 100644
--- a/OpenSim/Framework/IScene.cs
+++ b/OpenSim/Framework/IScene.cs
@@ -72,7 +72,15 @@ namespace OpenSim.Framework
string GetSimulatorVersion();
- bool PresenceChildStatus(UUID avatarID);
+ ///
+ /// Is the agent denoted by the given agentID a child presence in this scene?
+ ///
+ ///
+ /// Used by ClientView when a 'kick everyone' or 'estate message' occurs
+ ///
+ /// AvatarID to lookup
+ /// true if the presence is a child agent, false if the presence does not exist or is not a child agent
+ bool PresenceChildStatus(UUID agentId);
// Diva: get this out of here!!!
string GetCapsPath(UUID agentId);
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 9497043..873662e 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -4130,15 +4130,14 @@ namespace OpenSim.Region.Environment.Scenes
return m_sceneGraph.GetScenePresence(avatarID);
}
- ///
- /// Request an Avatar's Child Status - used by ClientView when a 'kick everyone' or 'estate message' occurs
- ///
- /// AvatarID to lookup
- ///
public override bool PresenceChildStatus(UUID avatarID)
{
ScenePresence cp = GetScenePresence(avatarID);
- return cp.IsChildAgent;
+
+ if (cp != null)
+ return cp.IsChildAgent;
+
+ return false;
}
///
--
cgit v1.1